QmlProfiler: Introduce properties for timeline category heights

Like this we can easily refer to them from QML and it makes it simpler
to see if we mean the overall height or the height of a single category.

Change-Id: Ia2b79d99b5c46c3d9563cfc2ed0715bc352ce9b4
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-09-02 12:45:18 +02:00
parent 2919dc617f
commit b2487e1683
7 changed files with 33 additions and 13 deletions

View File

@@ -167,7 +167,7 @@ void TimelineRenderer::drawItemsToPainter(QPainter *p, int modelIndex, int fromI
p->setPen(Qt::transparent);
int modelRowStart = 0;
for (int mi = 0; mi < modelIndex; mi++)
modelRowStart += m_profilerModelProxy->height(mi);
modelRowStart += m_profilerModelProxy->model(mi)->height();
for (int i = fromIndex; i <= toIndex; i++) {
int currentX, currentY, itemWidth, itemHeight;
@@ -203,7 +203,7 @@ void TimelineRenderer::drawSelectionBoxes(QPainter *p, int modelIndex, int fromI
int modelRowStart = 0;
for (int mi = 0; mi < modelIndex; mi++)
modelRowStart += m_profilerModelProxy->height(mi);
modelRowStart += m_profilerModelProxy->model(mi)->height();
p->save();
@@ -310,7 +310,7 @@ int TimelineRenderer::rowFromPosition(int y)
{
int ret = 0;
for (int modelIndex = 0; modelIndex < m_profilerModelProxy->modelCount(); modelIndex++) {
int modelHeight = m_profilerModelProxy->height(modelIndex);
int modelHeight = m_profilerModelProxy->model(modelIndex)->height();
if (y < modelHeight) {
for (int row = 0; row < m_profilerModelProxy->rowCount(modelIndex); ++row) {
y -= m_profilerModelProxy->rowHeight(modelIndex, row);
@@ -328,7 +328,7 @@ int TimelineRenderer::rowFromPosition(int y)
int TimelineRenderer::modelFromPosition(int y)
{
for (int modelIndex = 0; modelIndex < m_profilerModelProxy->modelCount(); modelIndex++) {
y -= m_profilerModelProxy->height(modelIndex);
y -= m_profilerModelProxy->model(modelIndex)->height();
if (y < 0)
return modelIndex;
}
@@ -469,7 +469,7 @@ int TimelineRenderer::getYPosition(int modelIndex, int index) const
int modelRowStart = 0;
for (int mi = 0; mi < modelIndex; mi++)
modelRowStart += m_profilerModelProxy->height(mi);
modelRowStart += m_profilerModelProxy->model(mi)->height();
return modelRowStart + m_profilerModelProxy->rowOffset(modelIndex,
m_profilerModelProxy->row(modelIndex, index));