diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-11-13 21:25:38 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-11-13 21:25:38 (GMT) |
commit | 9520eff2bb2f4dfeae37d91edfdc83ada2e925d2 (patch) | |
tree | 5651e8d3b5d820573016084b4eeb9a7e3e442019 | |
parent | 1d2b5ed44044d934c59b34a24ac76e8cda8120ab (diff) | |
download | CMake-9520eff2bb2f4dfeae37d91edfdc83ada2e925d2.zip CMake-9520eff2bb2f4dfeae37d91edfdc83ada2e925d2.tar.gz CMake-9520eff2bb2f4dfeae37d91edfdc83ada2e925d2.tar.bz2 |
ENH: add completer for the source and binary dir lineedits
Clinton: do I actually have to create separate models for each completer,
and a separate completer for each widget, or could the models/completers be
used for multiple widgets ?
Alex
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index afa3157..73d8879 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -25,6 +25,8 @@ #include <QDialogButtonBox> #include <QCloseEvent> #include <QCoreApplication> +#include <QCompleter> +#include <QDirModel> #include <QSettings> #include <QMenu> #include <QMenuBar> @@ -117,6 +119,18 @@ CMakeSetupDialog::CMakeSetupDialog() // get the saved binary directories QStringList buildPaths = this->loadBuildPaths(); this->BinaryDirectory->addItems(buildPaths); + + QCompleter* compBinaryDir = new QCompleter(this); + QDirModel* modelBinaryDir = new QDirModel(compBinaryDir); + modelBinaryDir->setFilter(QDir::NoDotAndDotDot | QDir::Dirs); + compBinaryDir->setModel(modelBinaryDir); + this->BinaryDirectory->setCompleter(compBinaryDir); + QCompleter* compSourceDir = new QCompleter(this); + QDirModel* modelSourceDir = new QDirModel(compSourceDir); + modelSourceDir->setFilter(QDir::NoDotAndDotDot | QDir::Dirs); + compSourceDir->setModel(modelSourceDir); + this->SourceDirectory->setCompleter(compSourceDir); + // start the cmake worker thread this->CMakeThread = new QCMakeThread(this); |