diff options
Diffstat (limited to 'Source/QtDialog/QCMakeCacheView.cxx')
-rw-r--r-- | Source/QtDialog/QCMakeCacheView.cxx | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index e14b322..4003c2f 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -88,7 +88,7 @@ QModelIndex QCMakeCacheView::moveCursor(CursorAction act, } QCMakeCacheModel::QCMakeCacheModel(QObject* p) - : QAbstractTableModel(p), IsDirty(false) + : QAbstractTableModel(p), NewCount(0), IsDirty(false) { } @@ -101,9 +101,28 @@ bool QCMakeCacheModel::isDirty() const return this->IsDirty; } +static uint qHash(const QCMakeCacheProperty& p) +{ + return qHash(p.Key); +} + void QCMakeCacheModel::setProperties(const QCMakeCachePropertyList& props) { - this->Properties = props; + QSet<QCMakeCacheProperty> newProps = props.toSet(); + QSet<QCMakeCacheProperty> oldProps = this->Properties.toSet(); + + oldProps.intersect(newProps); + newProps.subtract(oldProps); + + this->NewCount = newProps.count(); + this->Properties.clear(); + + this->Properties = newProps.toList(); + qSort(this->Properties); + QCMakeCachePropertyList tmp = oldProps.toList(); + qSort(tmp); + this->Properties += tmp; + this->reset(); this->IsDirty = false; } @@ -155,6 +174,10 @@ QVariant QCMakeCacheModel::data (const QModelIndex& index, int role) const { return this->Properties[index.row()].Advanced; } + else if(role == Qt::BackgroundRole && index.row()+1 <= this->NewCount) + { + return QBrush(QColor(255,100,100)); + } return QVariant(); } |