summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/QCMakeCacheView.h
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2007-11-03 14:30:52 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2007-11-03 14:30:52 (GMT)
commit77ad85a6ab00959b972f5f2ad86382e2161b92b6 (patch)
treedffe50dd916306eefcefd39e0f7fb20dc375bc27 /Source/QtDialog/QCMakeCacheView.h
parentc139a096c7cb73a8184b69f20a837d97c00b5a96 (diff)
downloadCMake-77ad85a6ab00959b972f5f2ad86382e2161b92b6.zip
CMake-77ad85a6ab00959b972f5f2ad86382e2161b92b6.tar.gz
CMake-77ad85a6ab00959b972f5f2ad86382e2161b92b6.tar.bz2
ENH: Add interrupt button near progress bar.
Implement help button. Implement cancel button. Add scrollable output window. Replace ON/OFF & combobox editors with checkboxes. Tab/backtab in cache table jumps between values (not names and values) Add tooltips to show help strings. Add application icon and qtmain for Windows. BUG: Fix save of cache values on configure.
Diffstat (limited to 'Source/QtDialog/QCMakeCacheView.h')
-rw-r--r--Source/QtDialog/QCMakeCacheView.h39
1 files changed, 14 insertions, 25 deletions
diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h
index da71de1..692f451 100644
--- a/Source/QtDialog/QCMakeCacheView.h
+++ b/Source/QtDialog/QCMakeCacheView.h
@@ -20,7 +20,7 @@
#include <QTableView>
#include <QAbstractTableModel>
-#include <QComboBox>
+#include <QCheckBox>
#include <QLineEdit>
#include <QItemDelegate>
@@ -38,7 +38,9 @@ public:
QCMakeCacheModel* cacheModel() const;
protected:
- bool event(QEvent*);
+ QModelIndex moveCursor(CursorAction, Qt::KeyboardModifiers);
+ void showEvent(QShowEvent* e);
+ bool Init;
};
/// Qt model class for cache properties
@@ -55,6 +57,7 @@ public slots:
void setProperties(const QCMakeCachePropertyList& props);
public:
+ // satisfy [pure] virtuals
int columnCount ( const QModelIndex & parent ) const;
QVariant data ( const QModelIndex & index, int role ) const;
QModelIndex parent ( const QModelIndex & index ) const;
@@ -63,10 +66,14 @@ public:
Qt::ItemFlags flags ( const QModelIndex& index ) const;
bool setData ( const QModelIndex& index, const QVariant& value, int role );
+ // flag if a cache property has been modified
+ bool isDirty() const;
+ // get the properties
QCMakeCachePropertyList properties() const;
protected:
QCMakeCachePropertyList Properties;
+ bool IsDirty;
};
/// Qt delegate class for interaction (or other customization) with cache properties
@@ -75,41 +82,23 @@ class QCMakeCacheModelDelegate : public QItemDelegate
Q_OBJECT
public:
QCMakeCacheModelDelegate(QObject* p);
+ /// create our own editors for cache properties
QWidget* createEditor(QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
};
-/// Editor widget for editing paths
+/// Editor widget for editing paths or file paths
class QCMakeCachePathEditor : public QWidget
{
Q_OBJECT
Q_PROPERTY(QString value READ value USER true)
public:
- QCMakeCachePathEditor(const QString& file, QWidget* p);
- QString value() const;
+ QCMakeCachePathEditor(const QString& file, bool isFilePath, QWidget* p);
+ QString value() const { return this->LineEdit->text(); }
protected slots:
void chooseFile();
protected:
QLineEdit LineEdit;
-};
-
-/// Editor widget for editing file paths
-class QCMakeCacheFilePathEditor : public QWidget
-{
-};
-
-/// Editor widget for editing booleans
-class QCMakeCacheBoolEditor : public QComboBox
-{
- Q_OBJECT
- Q_PROPERTY(QString value READ currentText USER true)
-public:
- QCMakeCacheBoolEditor(const QString& val, QWidget* p)
- : QComboBox(p)
- {
- this->addItem("ON");
- this->addItem("OFF");
- this->setCurrentIndex(val == "ON" ? 0 : 1);
- }
+ bool IsFilePath;
};
#endif