mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Big improvement in speed ( callgrind )
This patch makes use of a cache variable instead of creating / accessing a new one via operator[], because for some reason QGraphicsPolygonItem doesn't return a reference for polygon and a copy is always made. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ed230f8aac
commit
151a90bec0
2 changed files with 2 additions and 2 deletions
|
@ -113,12 +113,13 @@ void DiveProfileItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* o
|
|||
QPen pen;
|
||||
pen.setCosmetic(true);
|
||||
pen.setWidth(2);
|
||||
QPolygonF poly = polygon();
|
||||
// This paints the colors of the velocities.
|
||||
for (int i = 1, count = dataModel->rowCount(); i < count; i++) {
|
||||
QModelIndex colorIndex = dataModel->index(i, DivePlotDataModel::COLOR);
|
||||
pen.setBrush(QBrush(colorIndex.data(Qt::BackgroundRole).value<QColor>()));
|
||||
painter->setPen(pen);
|
||||
painter->drawLine(polygon()[i-1],polygon()[i]);
|
||||
painter->drawLine(poly[i-1],poly[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -225,7 +225,6 @@ void ToolTipItem::refresh(const QPointF& pos)
|
|||
{
|
||||
clear();
|
||||
int time = timeAxis->valueAt( pos );
|
||||
qDebug() << "time" << time;
|
||||
char buffer[500];
|
||||
get_plot_details_new(&pInfo, time, buffer, 500);
|
||||
addToolTip(QString(buffer));
|
||||
|
|
Loading…
Reference in a new issue