1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Slider item cosmetics

This commit is contained in:
Martin Tůma 2015-10-19 23:57:45 +02:00
parent b9accff81e
commit 5fce0980e5

View File

@ -17,7 +17,7 @@ void SliderInfoItem::updateBoundingRect()
font.setFamily(FONT_FAMILY); font.setFamily(FONT_FAMILY);
QFontMetrics fm(font); QFontMetrics fm(font);
_boundingRect = QRectF(-SIZE/2, -SIZE/2, fm.width(_text) + SIZE, fm.height()); _boundingRect = QRectF(-SIZE/2, 0, fm.width(_text) + SIZE, fm.height());
} }
void SliderInfoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem void SliderInfoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem
@ -33,9 +33,9 @@ void SliderInfoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem
painter->setPen(Qt::red); painter->setPen(Qt::red);
painter->drawText(SIZE, fm.height() - fm.descent(), _text); painter->drawText(SIZE, fm.height() - fm.descent(), _text);
painter->fillRect(QRect(-SIZE/2, -SIZE/2, SIZE, SIZE), Qt::red); painter->drawLine(QPointF(-SIZE/2, 0), QPointF(SIZE/2, 0));
// painter->drawRect(boundingRect()); //painter->drawRect(boundingRect());
} }
void SliderInfoItem::setText(const QString &text) void SliderInfoItem::setText(const QString &text)