examples/assistant/simpletextviewer/findfiledialog.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
   174     directoryComboBox->setSizeAdjustPolicy(
   174     directoryComboBox->setSizeAdjustPolicy(
   175             QComboBox::AdjustToMinimumContentsLength);
   175             QComboBox::AdjustToMinimumContentsLength);
   176     directoryComboBox->setSizePolicy(QSizePolicy::Expanding,
   176     directoryComboBox->setSizePolicy(QSizePolicy::Expanding,
   177                                      QSizePolicy::Preferred);
   177                                      QSizePolicy::Preferred);
   178 
   178 
   179     connect(fileNameComboBox, SIGNAL(editTextChanged(const QString &)),
   179     connect(fileNameComboBox, SIGNAL(editTextChanged(QString)),
   180             this, SLOT(update()));
   180             this, SLOT(update()));
   181     connect(directoryComboBox, SIGNAL(currentIndexChanged(const QString &)),
   181     connect(directoryComboBox, SIGNAL(currentIndexChanged(QString)),
   182             this, SLOT(update()));
   182             this, SLOT(update()));
   183 }
   183 }
   184 
   184 
   185 void FindFileDialog::createFilesTree()
   185 void FindFileDialog::createFilesTree()
   186 {
   186 {
   188     foundFilesTree->setColumnCount(1);
   188     foundFilesTree->setColumnCount(1);
   189     foundFilesTree->setHeaderLabels(QStringList(tr("Matching Files")));
   189     foundFilesTree->setHeaderLabels(QStringList(tr("Matching Files")));
   190     foundFilesTree->setRootIsDecorated(false);
   190     foundFilesTree->setRootIsDecorated(false);
   191     foundFilesTree->setSelectionMode(QAbstractItemView::SingleSelection);
   191     foundFilesTree->setSelectionMode(QAbstractItemView::SingleSelection);
   192 
   192 
   193     connect(foundFilesTree, SIGNAL(itemActivated(QTreeWidgetItem *, int)),
   193     connect(foundFilesTree, SIGNAL(itemActivated(QTreeWidgetItem*,int)),
   194             this, SLOT(openFile(QTreeWidgetItem *)));
   194             this, SLOT(openFile(QTreeWidgetItem*)));
   195 }
   195 }
   196 
   196 
   197 void FindFileDialog::createLabels()
   197 void FindFileDialog::createLabels()
   198 {
   198 {
   199     directoryLabel = new QLabel(tr("Search in:"));
   199     directoryLabel = new QLabel(tr("Search in:"));