diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2007-11-09 06:14:37 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2007-11-09 06:14:37 (GMT) |
commit | c5b01a7daff1657063b938b60ee67bc710e07d6c (patch) | |
tree | 544f1d8e4900e0d246f811513bbbd05ccb67bef1 /Source/QtDialog/QCMakeCacheView.cxx | |
parent | 38d15310a3cee9d55427330bb2afffc49b251548 (diff) | |
download | CMake-c5b01a7daff1657063b938b60ee67bc710e07d6c.zip CMake-c5b01a7daff1657063b938b60ee67bc710e07d6c.tar.gz CMake-c5b01a7daff1657063b938b60ee67bc710e07d6c.tar.bz2 |
ENH: Add completion to editor for files and file paths.
Diffstat (limited to 'Source/QtDialog/QCMakeCacheView.cxx')
-rw-r--r-- | Source/QtDialog/QCMakeCacheView.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index 5fad885..729b9d8 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -29,6 +29,8 @@ #include <QDialog> #include <QLabel> #include <QDialogButtonBox> +#include <QDirModel> +#include <QCompleter> static QRegExp AdvancedRegExp[2] = { QRegExp("(false)"), QRegExp("(true|false)") }; @@ -438,6 +440,15 @@ QCMakeCachePathEditor::QCMakeCachePathEditor(bool fp, QWidget* p) this->ToolButton->setCursor(QCursor(Qt::ArrowCursor)); QObject::connect(this->ToolButton, SIGNAL(clicked(bool)), this, SLOT(chooseFile())); + QCompleter* comp = new QCompleter(this); + QDirModel* model = new QDirModel(comp); + if(!fp) + { + // only dirs + model->setFilter(QDir::AllDirs | QDir::Drives); + } + comp->setModel(model); + this->setCompleter(comp); } void QCMakeCachePathEditor::resizeEvent(QResizeEvent* e) |