diff options
Diffstat (limited to 'qt-ui/profile/divetooltipitem.h')
-rw-r--r-- | qt-ui/profile/divetooltipitem.h | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/qt-ui/profile/divetooltipitem.h b/qt-ui/profile/divetooltipitem.h index 5deb0001a..566b21770 100644 --- a/qt-ui/profile/divetooltipitem.h +++ b/qt-ui/profile/divetooltipitem.h @@ -17,36 +17,44 @@ 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 QGraphicsPathItem { Q_OBJECT void updateTitlePosition(); Q_PROPERTY(QRectF rect READ boundingRect WRITE setRect) public: - enum Status{COLLAPSED, EXPANDED}; - enum {ICON_SMALL = 16, ICON_MEDIUM = 24, ICON_BIG = 32, SPACING=4}; + enum Status { + COLLAPSED, + EXPANDED + }; + enum { + ICON_SMALL = 16, + ICON_MEDIUM = 24, + ICON_BIG = 32, + SPACING = 4 + }; - explicit ToolTipItem(QGraphicsItem* parent = 0); + explicit ToolTipItem(QGraphicsItem *parent = 0); virtual ~ToolTipItem(); void collapse(); void expand(); void clear(); - void addToolTip(const QString& toolTip, const QIcon& icon = QIcon()); - void refresh(struct graphics_context* gc, QPointF pos); - void refresh(const QPointF& pos); + void addToolTip(const QString &toolTip, const QIcon &icon = QIcon()); + void refresh(struct graphics_context *gc, QPointF pos); + void refresh(const QPointF &pos); bool isExpanded() const; void persistPos(); void readPos(); - void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); void setTimeAxis(DiveCartesianAxis *axis); - void setPlotInfo(const plot_info& plot); -public slots: - void setRect(const QRectF& rect); + void setPlotInfo(const plot_info &plot); +public +slots: + void setRect(const QRectF &rect); private: - typedef QPair<QGraphicsPixmapItem*, QGraphicsSimpleTextItem*> ToolTip; + typedef QPair<QGraphicsPixmapItem *, QGraphicsSimpleTextItem *> ToolTip; QVector<ToolTip> toolTips; QGraphicsPathItem *background; QGraphicsLineItem *separator; |