summaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/divetooltipitem.cpp13
-rw-r--r--profile-widget/divetooltipitem.h5
2 files changed, 3 insertions, 15 deletions
diff --git a/profile-widget/divetooltipitem.cpp b/profile-widget/divetooltipitem.cpp
index 908f40070..f62a68ad8 100644
--- a/profile-widget/divetooltipitem.cpp
+++ b/profile-widget/divetooltipitem.cpp
@@ -7,7 +7,6 @@
#include "core/settings/qPrefDisplay.h"
#include <QPropertyAnimation>
#include <QGraphicsView>
-#include <QStyleOptionGraphicsItem>
#include "core/qthelper.h"
void ToolTipItem::addToolTip(const QString &toolTip, const QIcon &icon, const QPixmap& pixmap)
@@ -133,7 +132,7 @@ void ToolTipItem::expand()
status = EXPANDED;
}
-ToolTipItem::ToolTipItem(QGraphicsItem *parent) : QGraphicsRectItem(parent),
+ToolTipItem::ToolTipItem(QGraphicsItem *parent) : RoundRectItem(parent),
title(new QGraphicsSimpleTextItem(tr("Information"), this)),
status(COLLAPSED),
timeAxis(0),
@@ -194,16 +193,6 @@ void ToolTipItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
}
}
-void ToolTipItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget*)
-{
- painter->save();
- painter->setClipRect(option->rect);
- painter->setPen(pen());
- painter->setBrush(brush());
- painter->drawRoundedRect(rect(), 8, 8, Qt::AbsoluteSize);
- painter->restore();
-}
-
void ToolTipItem::persistPos()
{
qPrefDisplay::set_tooltip_position(pos());
diff --git a/profile-widget/divetooltipitem.h b/profile-widget/divetooltipitem.h
index 268159621..c9e61b6d4 100644
--- a/profile-widget/divetooltipitem.h
+++ b/profile-widget/divetooltipitem.h
@@ -2,12 +2,12 @@
#ifndef DIVETOOLTIPITEM_H
#define DIVETOOLTIPITEM_H
-#include <QGraphicsRectItem>
#include <QVector>
#include <QPair>
#include <QRectF>
#include <QIcon>
#include <QElapsedTimer>
+#include "backend-shared/roundrectitem.h"
#include "core/display.h"
class DiveCartesianAxis;
@@ -18,7 +18,7 @@ class QGraphicsPixmapItem;
/* 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 QGraphicsRectItem {
+class ToolTipItem : public QObject, public RoundRectItem {
Q_OBJECT
void updateTitlePosition();
Q_PROPERTY(QRectF rect READ rect WRITE setRect)
@@ -45,7 +45,6 @@ public:
void setTimeAxis(DiveCartesianAxis *axis);
void setPlotInfo(const plot_info &plot);
void clearPlotInfo();
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
public
slots:
void setRect(const QRectF &rect);