mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
d8830ad31c
commit
deafa40d34
2 changed files with 12 additions and 19 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue