summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2007-11-09 06:14:37 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2007-11-09 06:14:37 (GMT)
commitc5b01a7daff1657063b938b60ee67bc710e07d6c (patch)
tree544f1d8e4900e0d246f811513bbbd05ccb67bef1
parent38d15310a3cee9d55427330bb2afffc49b251548 (diff)
downloadCMake-c5b01a7daff1657063b938b60ee67bc710e07d6c.zip
CMake-c5b01a7daff1657063b938b60ee67bc710e07d6c.tar.gz
CMake-c5b01a7daff1657063b938b60ee67bc710e07d6c.tar.bz2
ENH: Add completion to editor for files and file paths.
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx11
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)