forked from qt-creator/qt-creator
QmlProfiler: Don't convert between QColor and QVariantList
There is no reason to express colors as QVariantList. Change-Id: I8c816e547b2f9be0f02a9d275791021ac06cff4f Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user