diff options
author | Brad King <brad.king@kitware.com> | 2011-02-22 19:31:31 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2011-02-22 19:31:31 (GMT) |
commit | a38c1b3584e3009d525caa656798ab8b1dd5e9f8 (patch) | |
tree | bac7d82a84e7c7e88645f101bc49ad0ff5c09862 | |
parent | 554641f320dfaed924a8a0edd89d7a69cc3943f2 (diff) | |
parent | b1f52b1fd8dd13d22138b7b9c0701e699dbeb43c (diff) | |
download | CMake-a38c1b3584e3009d525caa656798ab8b1dd5e9f8.zip CMake-a38c1b3584e3009d525caa656798ab8b1dd5e9f8.tar.gz CMake-a38c1b3584e3009d525caa656798ab8b1dd5e9f8.tar.bz2 |
Merge topic 'qtdialog-groupingbug'
b1f52b1 Fix grouping bug where "Ungrouped Entries" showed up as a child.
-rw-r--r-- | Source/QtDialog/QCMakeCacheView.cxx | 14 | ||||
-rw-r--r-- | Source/QtDialog/QCMakeCacheView.h | 4 |
2 files changed, 13 insertions, 5 deletions
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index 562396d..72e9b24 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -293,6 +293,8 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) parentItems.append(new QStandardItem()); parentItems[0]->setData(QBrush(QColor(255,100,100)), Qt::BackgroundColorRole); parentItems[1]->setData(QBrush(QColor(255,100,100)), Qt::BackgroundColorRole); + parentItems[0]->setData(1, GroupRole); + parentItems[1]->setData(1, GroupRole); root->appendRow(parentItems); int num = props2.size(); @@ -314,6 +316,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) QStandardItem* parentItem = new QStandardItem(key.isEmpty() ? tr("Ungrouped Entries") : key); root->appendRow(parentItem); + parentItem->setData(1, GroupRole); int num = props2.size(); for(int i=0; i<num; i++) @@ -478,10 +481,13 @@ QCMakePropertyList QCMakeCacheModel::properties() const } else { - // get data - QCMakeProperty prop; - this->getPropertyData(idx, prop); - props.append(prop); + if(!data(idx, GroupRole).toInt()) + { + // get data + QCMakeProperty prop; + this->getPropertyData(idx, prop); + props.append(prop); + } // go to the next in the tree while(!idxs.isEmpty() && !idxs.last().sibling(idxs.last().row()+1, 0).isValid()) diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h index 58bbd2d..0a628b9 100644 --- a/Source/QtDialog/QCMakeCacheView.h +++ b/Source/QtDialog/QCMakeCacheView.h @@ -67,7 +67,9 @@ public: enum { HelpRole = Qt::ToolTipRole, TypeRole = Qt::UserRole, AdvancedRole, - StringsRole}; + StringsRole, + GroupRole + }; enum ViewType { FlatView, GroupView }; |