summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/QCMakeCacheView.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/QtDialog/QCMakeCacheView.cxx')
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index eca2b96..1937f24 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -124,7 +124,8 @@ void QCMakeCacheView::setSearchFilter(const QString& s)
}
QCMakeCacheModel::QCMakeCacheModel(QObject* p)
- : QAbstractTableModel(p), NewCount(0), ModifiedValues(false)
+ : QAbstractTableModel(p),
+ NewCount(0), ModifiedValues(false), EditEnabled(true)
{
}
@@ -173,6 +174,16 @@ QCMakeCachePropertyList QCMakeCacheModel::properties() const
return this->Properties;
}
+void QCMakeCacheModel::setEditEnabled(bool e)
+{
+ this->EditEnabled = e;
+}
+
+bool QCMakeCacheModel::editEnabled() const
+{
+ return this->EditEnabled;
+}
+
int QCMakeCacheModel::columnCount (const QModelIndex& /*p*/ ) const
{
return 2;
@@ -250,7 +261,7 @@ Qt::ItemFlags QCMakeCacheModel::flags (const QModelIndex& idx) const
{
Qt::ItemFlags f = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
// all column 1's are editable
- if(idx.column() == 1)
+ if(idx.column() == 1 && this->EditEnabled)
{
f |= Qt::ItemIsEditable;
// booleans are editable in place