forked from qt-creator/qt-creator
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user