[cmake-commits] alex committed CMakeSetupDialog.cxx 1.24 1.25

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Nov 13 16:25:40 EST 2007


Update of /cvsroot/CMake/CMake/Source/QtDialog
In directory public:/mounts/ram/cvs-serv24981

Modified Files:
	CMakeSetupDialog.cxx 
Log Message:
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


Index: CMakeSetupDialog.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/CMakeSetupDialog.cxx,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- CMakeSetupDialog.cxx	13 Nov 2007 05:33:22 -0000	1.24
+++ CMakeSetupDialog.cxx	13 Nov 2007 21:25:38 -0000	1.25
@@ -25,6 +25,8 @@
 #include <QDialogButtonBox>
 #include <QCloseEvent>
 #include <QCoreApplication>
+#include <QCompleter>
+#include <QDirModel>
 #include <QSettings>
 #include <QMenu>
 #include <QMenuBar>
@@ -117,6 +119,18 @@
   // 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);



More information about the Cmake-commits mailing list