Fix grouping bug where "Ungrouped Entries" showed up as a child.
This commit is contained in:
parent
6744616fb2
commit
b1f52b1fd8
|
@ -293,6 +293,8 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
|
||||||
parentItems.append(new QStandardItem());
|
parentItems.append(new QStandardItem());
|
||||||
parentItems[0]->setData(QBrush(QColor(255,100,100)), Qt::BackgroundColorRole);
|
parentItems[0]->setData(QBrush(QColor(255,100,100)), Qt::BackgroundColorRole);
|
||||||
parentItems[1]->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);
|
root->appendRow(parentItems);
|
||||||
|
|
||||||
int num = props2.size();
|
int num = props2.size();
|
||||||
|
@ -314,6 +316,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
|
||||||
QStandardItem* parentItem =
|
QStandardItem* parentItem =
|
||||||
new QStandardItem(key.isEmpty() ? tr("Ungrouped Entries") : key);
|
new QStandardItem(key.isEmpty() ? tr("Ungrouped Entries") : key);
|
||||||
root->appendRow(parentItem);
|
root->appendRow(parentItem);
|
||||||
|
parentItem->setData(1, GroupRole);
|
||||||
|
|
||||||
int num = props2.size();
|
int num = props2.size();
|
||||||
for(int i=0; i<num; i++)
|
for(int i=0; i<num; i++)
|
||||||
|
@ -478,10 +481,13 @@ QCMakePropertyList QCMakeCacheModel::properties() const
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// get data
|
if(!data(idx, GroupRole).toInt())
|
||||||
QCMakeProperty prop;
|
{
|
||||||
this->getPropertyData(idx, prop);
|
// get data
|
||||||
props.append(prop);
|
QCMakeProperty prop;
|
||||||
|
this->getPropertyData(idx, prop);
|
||||||
|
props.append(prop);
|
||||||
|
}
|
||||||
|
|
||||||
// go to the next in the tree
|
// go to the next in the tree
|
||||||
while(!idxs.isEmpty() && !idxs.last().sibling(idxs.last().row()+1, 0).isValid())
|
while(!idxs.isEmpty() && !idxs.last().sibling(idxs.last().row()+1, 0).isValid())
|
||||||
|
|
|
@ -67,7 +67,9 @@ public:
|
||||||
enum { HelpRole = Qt::ToolTipRole,
|
enum { HelpRole = Qt::ToolTipRole,
|
||||||
TypeRole = Qt::UserRole,
|
TypeRole = Qt::UserRole,
|
||||||
AdvancedRole,
|
AdvancedRole,
|
||||||
StringsRole};
|
StringsRole,
|
||||||
|
GroupRole
|
||||||
|
};
|
||||||
|
|
||||||
enum ViewType { FlatView, GroupView };
|
enum ViewType { FlatView, GroupView };
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue