From 12dd46c1409dee7f09dcd970728681976459296e Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 16 Jan 2015 16:17:26 -0200 Subject: Implement the paint method to draw the rounded rectangle. The rectangle is now correct, but the collors are still wrong. I'm tracking that down - most probably I've set the wrong pen or brush ( or both ) somewhere. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/divetooltipitem.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'qt-ui/profile/divetooltipitem.cpp') diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp index a8685673c..42aaf1d2c 100644 --- a/qt-ui/profile/divetooltipitem.cpp +++ b/qt-ui/profile/divetooltipitem.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #define PORT_IN_PROGRESS 1 @@ -184,6 +185,17 @@ void ToolTipItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) } } +void ToolTipItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + Q_UNUSED(widget); + painter->save(); + painter->setClipRect(option->rect); + painter->setPen(pen()); + painter->setBrush(brush()); + painter->drawRoundedRect(rect(), 10, 10, Qt::AbsoluteSize); + painter->restore(); +} + void ToolTipItem::persistPos() { QSettings s; -- cgit v1.2.3-70-g09d2