From c5b01a7daff1657063b938b60ee67bc710e07d6c Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Fri, 9 Nov 2007 01:14:37 -0500 Subject: [PATCH] ENH: Add completion to editor for files and file paths. --- Source/QtDialog/QCMakeCacheView.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index 5fad885e1..729b9d861 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -29,6 +29,8 @@ #include #include #include +#include +#include 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)