forked from qt-creator/qt-creator
QmlProfiler: resetting expanded when data changes
Change-Id: Iaacbe03eecb0679da03006f439e10b1e2dfe9167 Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -64,6 +64,7 @@ public:
|
|||||||
Q_INVOKABLE qint64 traceDuration() const;
|
Q_INVOKABLE qint64 traceDuration() const;
|
||||||
Q_INVOKABLE int getState() const;
|
Q_INVOKABLE int getState() const;
|
||||||
|
|
||||||
|
Q_INVOKABLE virtual bool expanded(int category) const = 0;
|
||||||
Q_INVOKABLE virtual void setExpanded(int category, bool expanded) = 0;
|
Q_INVOKABLE virtual void setExpanded(int category, bool expanded) = 0;
|
||||||
Q_INVOKABLE virtual int categoryDepth(int categoryIndex) const = 0;
|
Q_INVOKABLE virtual int categoryDepth(int categoryIndex) const = 0;
|
||||||
Q_INVOKABLE virtual int categoryCount() const = 0;
|
Q_INVOKABLE virtual int categoryCount() const = 0;
|
||||||
|
@@ -57,6 +57,8 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateHeight() {
|
function updateHeight() {
|
||||||
|
if (expanded != qmlProfilerModelProxy.expanded(modelIndex, categoryIndex))
|
||||||
|
expanded = qmlProfilerModelProxy.expanded(modelIndex, categoryIndex);
|
||||||
height = root.singleRowHeight * qmlProfilerModelProxy.categoryDepth(modelIndex, categoryIndex);
|
height = root.singleRowHeight * qmlProfilerModelProxy.categoryDepth(modelIndex, categoryIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -61,6 +61,7 @@ public:
|
|||||||
QVector <PaintEventsModelProxy::QmlPaintEventData> eventList;
|
QVector <PaintEventsModelProxy::QmlPaintEventData> eventList;
|
||||||
int minAnimationCount;
|
int minAnimationCount;
|
||||||
int maxAnimationCount;
|
int maxAnimationCount;
|
||||||
|
bool expanded;
|
||||||
|
|
||||||
PaintEventsModelProxy *q;
|
PaintEventsModelProxy *q;
|
||||||
};
|
};
|
||||||
@@ -113,6 +114,7 @@ void PaintEventsModelProxy::clear()
|
|||||||
d->eventList.clear();
|
d->eventList.clear();
|
||||||
d->minAnimationCount = 1;
|
d->minAnimationCount = 1;
|
||||||
d->maxAnimationCount = 1;
|
d->maxAnimationCount = 1;
|
||||||
|
d->expanded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PaintEventsModelProxy::dataChanged()
|
void PaintEventsModelProxy::dataChanged()
|
||||||
@@ -126,6 +128,7 @@ void PaintEventsModelProxy::dataChanged()
|
|||||||
emit stateChanged();
|
emit stateChanged();
|
||||||
emit dataAvailable();
|
emit dataAvailable();
|
||||||
emit emptyChanged();
|
emit emptyChanged();
|
||||||
|
emit expandedChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool compareStartTimes(const PaintEventsModelProxy::QmlPaintEventData &t1, const PaintEventsModelProxy::QmlPaintEventData &t2)
|
bool compareStartTimes(const PaintEventsModelProxy::QmlPaintEventData &t1, const PaintEventsModelProxy::QmlPaintEventData &t2)
|
||||||
@@ -199,10 +202,15 @@ qint64 PaintEventsModelProxy::lastTimeMark() const
|
|||||||
return d->eventList.last().startTime + d->eventList.last().duration;
|
return d->eventList.last().startTime + d->eventList.last().duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PaintEventsModelProxy::expanded(int category) const
|
||||||
|
{
|
||||||
|
return d->expanded;
|
||||||
|
}
|
||||||
|
|
||||||
void PaintEventsModelProxy::setExpanded(int category, bool expanded)
|
void PaintEventsModelProxy::setExpanded(int category, bool expanded)
|
||||||
{
|
{
|
||||||
Q_UNUSED(category);
|
Q_UNUSED(category);
|
||||||
Q_UNUSED(expanded);
|
d->expanded = expanded;
|
||||||
emit expandedChanged();
|
emit expandedChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -80,6 +80,7 @@ public:
|
|||||||
|
|
||||||
Q_INVOKABLE qint64 lastTimeMark() const;
|
Q_INVOKABLE qint64 lastTimeMark() const;
|
||||||
|
|
||||||
|
Q_INVOKABLE bool expanded(int category) const;
|
||||||
Q_INVOKABLE void setExpanded(int category, bool expanded);
|
Q_INVOKABLE void setExpanded(int category, bool expanded);
|
||||||
Q_INVOKABLE int categoryDepth(int categoryIndex) const;
|
Q_INVOKABLE int categoryDepth(int categoryIndex) const;
|
||||||
Q_INVOKABLE int categoryCount() const;
|
Q_INVOKABLE int categoryCount() const;
|
||||||
|
@@ -135,6 +135,7 @@ void BasicTimelineModel::dataChanged()
|
|||||||
emit stateChanged();
|
emit stateChanged();
|
||||||
emit dataAvailable();
|
emit dataAvailable();
|
||||||
emit emptyChanged();
|
emit emptyChanged();
|
||||||
|
emit expandedChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasicTimelineModel::BasicTimelineModelPrivate::prepare()
|
void BasicTimelineModel::BasicTimelineModelPrivate::prepare()
|
||||||
@@ -393,6 +394,13 @@ qint64 BasicTimelineModel::lastTimeMark() const
|
|||||||
return d->startTimeData.last().startTime + d->startTimeData.last().duration;
|
return d->startTimeData.last().startTime + d->startTimeData.last().duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool BasicTimelineModel::expanded(int category) const
|
||||||
|
{
|
||||||
|
if (d->categorySpan.count() <= category)
|
||||||
|
return false;
|
||||||
|
return d->categorySpan[category].expanded;
|
||||||
|
}
|
||||||
|
|
||||||
void BasicTimelineModel::setExpanded(int category, bool expanded)
|
void BasicTimelineModel::setExpanded(int category, bool expanded)
|
||||||
{
|
{
|
||||||
if (d->categorySpan.count() <= category)
|
if (d->categorySpan.count() <= category)
|
||||||
|
@@ -101,6 +101,7 @@ public:
|
|||||||
|
|
||||||
Q_INVOKABLE qint64 lastTimeMark() const;
|
Q_INVOKABLE qint64 lastTimeMark() const;
|
||||||
|
|
||||||
|
Q_INVOKABLE bool expanded(int category) const;
|
||||||
Q_INVOKABLE void setExpanded(int category, bool expanded);
|
Q_INVOKABLE void setExpanded(int category, bool expanded);
|
||||||
Q_INVOKABLE int categoryDepth(int categoryIndex) const;
|
Q_INVOKABLE int categoryDepth(int categoryIndex) const;
|
||||||
Q_INVOKABLE int categoryCount() const;
|
Q_INVOKABLE int categoryCount() const;
|
||||||
|
@@ -176,6 +176,11 @@ qint64 TimelineModelAggregator::lastTimeMark() const
|
|||||||
return mark;
|
return mark;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TimelineModelAggregator::expanded(int modelIndex, int category) const
|
||||||
|
{
|
||||||
|
return d->modelList[modelIndex]->expanded(category);
|
||||||
|
}
|
||||||
|
|
||||||
void TimelineModelAggregator::setExpanded(int modelIndex, int category, bool expanded)
|
void TimelineModelAggregator::setExpanded(int modelIndex, int category, bool expanded)
|
||||||
{
|
{
|
||||||
// int modelIndex = modelIndexForCategory(category);
|
// int modelIndex = modelIndexForCategory(category);
|
||||||
|
@@ -68,6 +68,7 @@ public:
|
|||||||
|
|
||||||
Q_INVOKABLE qint64 lastTimeMark() const;
|
Q_INVOKABLE qint64 lastTimeMark() const;
|
||||||
|
|
||||||
|
Q_INVOKABLE bool expanded(int modelIndex, int category) const;
|
||||||
Q_INVOKABLE void setExpanded(int modelIndex, int category, bool expanded);
|
Q_INVOKABLE void setExpanded(int modelIndex, int category, bool expanded);
|
||||||
Q_INVOKABLE int categoryDepth(int modelIndex, int categoryIndex) const;
|
Q_INVOKABLE int categoryDepth(int modelIndex, int categoryIndex) const;
|
||||||
Q_INVOKABLE int categoryCount(int modelIndex) const;
|
Q_INVOKABLE int categoryCount(int modelIndex) const;
|
||||||
|
@@ -101,6 +101,11 @@ qint64 PixmapCacheModel::lastTimeMark() const
|
|||||||
return d->eventList.last().startTime;
|
return d->eventList.last().startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PixmapCacheModel::expanded(int category) const
|
||||||
|
{
|
||||||
|
return d->isExpanded;
|
||||||
|
}
|
||||||
|
|
||||||
void PixmapCacheModel::setExpanded(int category, bool expanded)
|
void PixmapCacheModel::setExpanded(int category, bool expanded)
|
||||||
{
|
{
|
||||||
Q_UNUSED(category);
|
Q_UNUSED(category);
|
||||||
@@ -467,6 +472,7 @@ void PixmapCacheModel::clear()
|
|||||||
d->pixmapSizes.clear();
|
d->pixmapSizes.clear();
|
||||||
d->collapsedRowCount = 1;
|
d->collapsedRowCount = 1;
|
||||||
d->expandedRowCount = 1;
|
d->expandedRowCount = 1;
|
||||||
|
d->isExpanded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PixmapCacheModel::dataChanged()
|
void PixmapCacheModel::dataChanged()
|
||||||
@@ -480,7 +486,7 @@ void PixmapCacheModel::dataChanged()
|
|||||||
emit stateChanged();
|
emit stateChanged();
|
||||||
emit dataAvailable();
|
emit dataAvailable();
|
||||||
emit emptyChanged();
|
emit emptyChanged();
|
||||||
return;
|
emit expandedChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PixmapCacheModel::PixmapCacheModelPrivate::computeCacheSizes()
|
void PixmapCacheModel::PixmapCacheModelPrivate::computeCacheSizes()
|
||||||
|
@@ -73,6 +73,7 @@ public:
|
|||||||
|
|
||||||
Q_INVOKABLE qint64 lastTimeMark() const;
|
Q_INVOKABLE qint64 lastTimeMark() const;
|
||||||
|
|
||||||
|
Q_INVOKABLE bool expanded(int category) const;
|
||||||
Q_INVOKABLE void setExpanded(int category, bool expanded);
|
Q_INVOKABLE void setExpanded(int category, bool expanded);
|
||||||
Q_INVOKABLE int categoryDepth(int categoryIndex) const;
|
Q_INVOKABLE int categoryDepth(int categoryIndex) const;
|
||||||
Q_INVOKABLE int categoryCount() const;
|
Q_INVOKABLE int categoryCount() const;
|
||||||
|
@@ -109,6 +109,11 @@ qint64 SceneGraphTimelineModel::lastTimeMark() const
|
|||||||
return d->eventList.last().startTime;
|
return d->eventList.last().startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SceneGraphTimelineModel::expanded(int category) const
|
||||||
|
{
|
||||||
|
return d->isExpanded;
|
||||||
|
}
|
||||||
|
|
||||||
void SceneGraphTimelineModel::setExpanded(int category, bool expanded)
|
void SceneGraphTimelineModel::setExpanded(int category, bool expanded)
|
||||||
{
|
{
|
||||||
Q_UNUSED(category);
|
Q_UNUSED(category);
|
||||||
@@ -462,6 +467,7 @@ void SceneGraphTimelineModel::loadData()
|
|||||||
void SceneGraphTimelineModel::clear()
|
void SceneGraphTimelineModel::clear()
|
||||||
{
|
{
|
||||||
d->eventList.clear();
|
d->eventList.clear();
|
||||||
|
d->isExpanded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneGraphTimelineModel::dataChanged()
|
void SceneGraphTimelineModel::dataChanged()
|
||||||
@@ -475,7 +481,7 @@ void SceneGraphTimelineModel::dataChanged()
|
|||||||
emit stateChanged();
|
emit stateChanged();
|
||||||
emit dataAvailable();
|
emit dataAvailable();
|
||||||
emit emptyChanged();
|
emit emptyChanged();
|
||||||
return;
|
emit expandedChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -61,6 +61,7 @@ public:
|
|||||||
|
|
||||||
Q_INVOKABLE qint64 lastTimeMark() const;
|
Q_INVOKABLE qint64 lastTimeMark() const;
|
||||||
|
|
||||||
|
Q_INVOKABLE bool expanded(int category) const;
|
||||||
Q_INVOKABLE void setExpanded(int category, bool expanded);
|
Q_INVOKABLE void setExpanded(int category, bool expanded);
|
||||||
Q_INVOKABLE int categoryDepth(int categoryIndex) const;
|
Q_INVOKABLE int categoryDepth(int categoryIndex) const;
|
||||||
Q_INVOKABLE int categoryCount() const;
|
Q_INVOKABLE int categoryCount() const;
|
||||||
|
Reference in New Issue
Block a user