forked from qt-creator/qt-creator
Define separate methods for getting collapsed and expanded rows
Change-Id: I3449e163dd00283a04fd5147d81034d2f68a961f Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
@@ -70,13 +70,17 @@ QVariantMap InputEventsModel::details(int index) const
|
||||
return result;
|
||||
}
|
||||
|
||||
int InputEventsModel::row(int index) const
|
||||
int InputEventsModel::expandedRow(int index) const
|
||||
{
|
||||
if (!expanded())
|
||||
return 1;
|
||||
return selectionId(index) == QmlDebug::Mouse ? 1 : 2;
|
||||
}
|
||||
|
||||
int InputEventsModel::collapsedRow(int index) const
|
||||
{
|
||||
Q_UNUSED(index)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void InputEventsModel::loadData()
|
||||
{
|
||||
clear();
|
||||
|
@@ -38,7 +38,8 @@ public:
|
||||
QColor color(int index) const;
|
||||
QVariantList labels() const;
|
||||
QVariantMap details(int index) const;
|
||||
int row(int index) const;
|
||||
int expandedRow(int index) const;
|
||||
int collapsedRow(int index) const;
|
||||
void loadData();
|
||||
void clear();
|
||||
|
||||
|
@@ -42,13 +42,15 @@ int MemoryUsageModel::rowMaxValue(int rowNumber) const
|
||||
return m_maxSize;
|
||||
}
|
||||
|
||||
int MemoryUsageModel::row(int index) const
|
||||
int MemoryUsageModel::expandedRow(int index) const
|
||||
{
|
||||
int type = selectionId(index);
|
||||
if (type == QmlDebug::HeapPage || type == QmlDebug::LargeItem)
|
||||
return 1;
|
||||
else
|
||||
return 2;
|
||||
return (type == QmlDebug::HeapPage || type == QmlDebug::LargeItem) ? 1 : 2;
|
||||
}
|
||||
|
||||
int MemoryUsageModel::collapsedRow(int index) const
|
||||
{
|
||||
return expandedRow(index);
|
||||
}
|
||||
|
||||
int MemoryUsageModel::typeId(int index) const
|
||||
|
@@ -50,7 +50,8 @@ public:
|
||||
|
||||
int rowMaxValue(int rowNumber) const;
|
||||
|
||||
int row(int index) const;
|
||||
int expandedRow(int index) const;
|
||||
int collapsedRow(int index) const;
|
||||
int typeId(int index) const;
|
||||
QColor color(int index) const;
|
||||
float relativeHeight(int index) const;
|
||||
|
@@ -43,10 +43,13 @@ int PixmapCacheModel::rowMaxValue(int rowNumber) const
|
||||
}
|
||||
}
|
||||
|
||||
int PixmapCacheModel::row(int index) const
|
||||
int PixmapCacheModel::expandedRow(int index) const
|
||||
{
|
||||
if (expanded())
|
||||
return selectionId(index) + 1;
|
||||
}
|
||||
|
||||
int PixmapCacheModel::collapsedRow(int index) const
|
||||
{
|
||||
return m_data[index].rowNumberCollapsed;
|
||||
}
|
||||
|
||||
|
@@ -89,7 +89,8 @@ public:
|
||||
|
||||
int rowMaxValue(int rowNumber) const;
|
||||
|
||||
int row(int index) const;
|
||||
int expandedRow(int index) const;
|
||||
int collapsedRow(int index) const;
|
||||
int typeId(int index) const;
|
||||
QColor color(int index) const;
|
||||
float relativeHeight(int index) const;
|
||||
|
@@ -77,9 +77,14 @@ SceneGraphTimelineModel::SceneGraphTimelineModel(QmlProfilerModelManager *manage
|
||||
announceFeatures(1 << QmlDebug::ProfileSceneGraph);
|
||||
}
|
||||
|
||||
int SceneGraphTimelineModel::row(int index) const
|
||||
int SceneGraphTimelineModel::expandedRow(int index) const
|
||||
{
|
||||
return expanded() ? (selectionId(index) + 1) : m_data[index].rowNumberCollapsed;
|
||||
return selectionId(index) + 1;
|
||||
}
|
||||
|
||||
int SceneGraphTimelineModel::collapsedRow(int index) const
|
||||
{
|
||||
return m_data[index].rowNumberCollapsed;
|
||||
}
|
||||
|
||||
int SceneGraphTimelineModel::typeId(int index) const
|
||||
|
@@ -79,7 +79,8 @@ public:
|
||||
|
||||
SceneGraphTimelineModel(QmlProfiler::QmlProfilerModelManager *manager, QObject *parent = 0);
|
||||
|
||||
int row(int index) const;
|
||||
int expandedRow(int index) const;
|
||||
int collapsedRow(int index) const;
|
||||
int typeId(int index) const;
|
||||
QColor color(int index) const;
|
||||
|
||||
|
Reference in New Issue
Block a user