diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-01-16 16:01:54 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-17 08:03:18 +1300 |
commit | deafa40d34f2a4c86a51aed6eb57c542356387db (patch) | |
tree | ac44d9d674b6c3c9fe758002b2a0102755ea13d4 /qt-ui/profile/divetooltipitem.h | |
parent | d8830ad31c9e84b215df15f30e79dc13ee59c39c (diff) | |
download | subsurface-deafa40d34f2a4c86a51aed6eb57c542356387db.tar.gz |
Inherit from QGraphicsRectItem instead of QGraphicsShapeItem
a rectangle is *much* faster to paint than a simple ShapeItem,
so this is a safer choice. We still need to create the paint
method so we can use the correct roundness for the rectangle.
Currently it's white with a 1px solid line - terrible. :)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divetooltipitem.h')
-rw-r--r-- | qt-ui/profile/divetooltipitem.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qt-ui/profile/divetooltipitem.h b/qt-ui/profile/divetooltipitem.h index ca5bc8905..7ac9d8652 100644 --- a/qt-ui/profile/divetooltipitem.h +++ b/qt-ui/profile/divetooltipitem.h @@ -1,7 +1,7 @@ #ifndef DIVETOOLTIPITEM_H #define DIVETOOLTIPITEM_H -#include <QGraphicsPathItem> +#include <QGraphicsRectItem> #include <QVector> #include <QPair> #include <QRectF> @@ -17,10 +17,10 @@ struct graphics_context; /* To use a tooltip, simply ->setToolTip on the QGraphicsItem that you want * or, if it's a "global" tooltip, set it on the mouseMoveEvent of the ProfileGraphicsView. */ -class ToolTipItem : public QObject, public QGraphicsPathItem { +class ToolTipItem : public QObject, public QGraphicsRectItem { Q_OBJECT void updateTitlePosition(); - Q_PROPERTY(QRectF rect READ boundingRect WRITE setRect) + Q_PROPERTY(QRectF rect READ rect WRITE setRect) public: enum Status { |