QmlProfiler: rename relative height of timeline items to "relativeHeight"

This clarifies that the item height is not absolute but relative to the
row height, and it reduces the ambiguity of the various "height" methods.

Change-Id: I391441147c88b47a14e539fc3853702bb517d27b
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-09-02 12:19:33 +02:00
parent 9e52d0c6d4
commit 2677e33782
9 changed files with 11 additions and 11 deletions

View File

@@ -168,7 +168,7 @@ int AbstractTimelineModel::bindingLoopDest(int index) const
return -1;
}
float AbstractTimelineModel::height(int index) const
float AbstractTimelineModel::relativeHeight(int index) const
{
Q_UNUSED(index);
return 1.0f;

View File

@@ -81,7 +81,7 @@ public:
virtual int eventIdForTypeIndex(int typeIndex) const;
virtual int eventIdForLocation(const QString &filename, int line, int column) const;
virtual int bindingLoopDest(int index) const;
virtual float height(int index) const;
virtual float relativeHeight(int index) const;
virtual int rowMinValue(int rowNumber) const;
virtual int rowMaxValue(int rowNumber) const;
virtual void clear();

View File

@@ -66,7 +66,7 @@ function drawData(canvas, ctxt)
xx = Math.round(xx);
var itemHeight = qmlProfilerModelProxy.height(modelIndex,ii) * blockHeight;
var itemHeight = qmlProfilerModelProxy.relativeHeight(modelIndex, ii) * blockHeight;
var yy = (modelIndex + 1) * blockHeight - itemHeight ;
ctxt.fillStyle = qmlProfilerModelProxy.color(modelIndex, ii);

View File

@@ -193,7 +193,7 @@ QColor PaintEventsModelProxy::color(int index) const
return colorByFraction(fpsFraction);
}
float PaintEventsModelProxy::height(int index) const
float PaintEventsModelProxy::relativeHeight(int index) const
{
Q_D(const PaintEventsModelProxy);
const QmlPaintEventData &data = d->data[index];

View File

@@ -71,7 +71,7 @@ public:
int row(int index) const;
QColor color(int index) const;
float height(int index) const;
float relativeHeight(int index) const;
QVariantList labels() const;
QVariantMap details(int index) const;

View File

@@ -224,9 +224,9 @@ QColor TimelineModelAggregator::color(int modelIndex, int index) const
return d->modelList[modelIndex]->color(index);
}
float TimelineModelAggregator::height(int modelIndex, int index) const
float TimelineModelAggregator::relativeHeight(int modelIndex, int index) const
{
return d->modelList[modelIndex]->height(index);
return d->modelList[modelIndex]->relativeHeight(index);
}
QVariantList TimelineModelAggregator::labels(int modelIndex) const

View File

@@ -81,7 +81,7 @@ public:
Q_INVOKABLE int eventId(int modelIndex, int index) const;
Q_INVOKABLE int bindingLoopDest(int modelIndex, int index) const;
Q_INVOKABLE QColor color(int modelIndex, int index) const;
Q_INVOKABLE float height(int modelIndex, int index) const;
Q_INVOKABLE float relativeHeight(int modelIndex, int index) const;
Q_INVOKABLE QVariantList labels(int modelIndex) const;

View File

@@ -174,7 +174,7 @@ void TimelineRenderer::drawItemsToPainter(QPainter *p, int modelIndex, int fromI
continue;
itemHeight = m_profilerModelProxy->rowHeight(modelIndex, rowNumber) *
m_profilerModelProxy->height(modelIndex, i);
m_profilerModelProxy->relativeHeight(modelIndex, i);
currentY += m_profilerModelProxy->rowHeight(modelIndex, rowNumber) - itemHeight;
if (currentY + itemHeight < 0)
@@ -220,7 +220,7 @@ void TimelineRenderer::drawSelectionBoxes(QPainter *p, int modelIndex, int fromI
int row = m_profilerModelProxy->row(modelIndex, i);
int rowHeight = m_profilerModelProxy->rowHeight(modelIndex, row);
int itemHeight = rowHeight * m_profilerModelProxy->height(modelIndex, i);
int itemHeight = rowHeight * m_profilerModelProxy->relativeHeight(modelIndex, i);
currentY = modelRowStart + m_profilerModelProxy->rowOffset(modelIndex, row) + rowHeight -
itemHeight - y();