QmlProfiler: Add some more consistency to flame graph model

model.parent(someFirstLevelItem) should return the invisible root item.
Methods with default parameter in the base class should also have a
default parameter in the derived class. As rowCount() is Q_INVOKABLE
columnCount() should also be.

Change-Id: I62a0ec6f91d01581fd47a43c97af63c58cdd13fa
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-05-30 17:38:45 +02:00
parent 7dce6bb4f2
commit 4436a1c7f2
2 changed files with 5 additions and 3 deletions

View File

@@ -222,7 +222,8 @@ QModelIndex FlameGraphModel::parent(const QModelIndex &child) const
{
if (child.isValid()) {
FlameGraphData *childData = static_cast<FlameGraphData *>(child.internalPointer());
return createIndex(0, 0, childData->parent);
return childData->parent == &m_stackBottom ? QModelIndex() :
createIndex(0, 0, childData->parent);
} else {
return QModelIndex();
}