Commit 1c4db840 authored by Ulf Hermann's avatar Ulf Hermann

QmlProfiler: Don't convert between QColor and QVariantList

There is no reason to express colors as QVariantList.

Change-Id: I8c816e547b2f9be0f02a9d275791021ac06cff4f
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent 94722ec5
......@@ -74,8 +74,7 @@ function drawData(canvas, ctxt)
var itemHeight = qmlProfilerModelProxy.getHeight(modelIndex,ii) * blockHeight;
var yy = (rowNumber + 1) * blockHeight - itemHeight ;
var itemColor = qmlProfilerModelProxy.getColorRGB(modelIndex, ii);
ctxt.fillStyle = "rgb("+itemColor[0]+","+itemColor[1]+","+itemColor[2]+")";
ctxt.fillStyle = qmlProfilerModelProxy.getColor(modelIndex, ii);
ctxt.fillRect(xx, bump + yy, eventWidth, itemHeight);
}
modelRowStart += qmlProfilerModelProxy.categoryCount(modelIndex);
......
......@@ -277,17 +277,6 @@ QColor TimelineModelAggregator::getColor(int modelIndex, int index) const
return d->modelList[modelIndex]->getColor(index);
}
QVariantList TimelineModelAggregator::getColorRGB(int modelIndex, int itemIndex) const
{
// return color as RGB list, for use in Qml
QColor c = getColor(modelIndex, itemIndex);
QVariantList res;
res.append(QVariant(c.red()));
res.append(QVariant(c.green()));
res.append(QVariant(c.blue()));
return res;
}
float TimelineModelAggregator::getHeight(int modelIndex, int index) const
{
return d->modelList[modelIndex]->getHeight(index);
......
......@@ -87,7 +87,6 @@ public:
Q_INVOKABLE int getEventId(int modelIndex, int index) const;
Q_INVOKABLE int getBindingLoopDest(int modelIndex, int index) const;
Q_INVOKABLE QColor getColor(int modelIndex, int index) const;
Q_INVOKABLE QVariantList getColorRGB(int modelIndex, int itemIndex) const;
Q_INVOKABLE float getHeight(int modelIndex, int index) const;
Q_INVOKABLE const QVariantList getLabelsForCategory(int modelIndex, int category) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment