diff options
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/profile/divetooltipitem.cpp | 11 | ||||
-rw-r--r-- | qt-ui/profile/divetooltipitem.h | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp index 45f415419..032daf6ee 100644 --- a/qt-ui/profile/divetooltipitem.cpp +++ b/qt-ui/profile/divetooltipitem.cpp @@ -1,5 +1,6 @@ #include "divetooltipitem.h" #include "divecartesianaxis.h" +#include "profilewidget2.h" #include "profile.h" #include "dive.h" #include "membuffer.h" @@ -180,6 +181,9 @@ void ToolTipItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { persistPos(); QGraphicsPathItem::mouseReleaseEvent(event); + Q_FOREACH (QGraphicsItem *item, oldSelection) { + item->setSelected(true); + } } void ToolTipItem::persistPos() @@ -231,3 +235,10 @@ void ToolTipItem::refresh(const QPointF &pos) addToolTip(item->toolTip()); } } + +void ToolTipItem::mousePressEvent(QGraphicsSceneMouseEvent *event) +{ + oldSelection = scene()->selectedItems(); + scene()->clearSelection(); + QGraphicsItem::mousePressEvent(event); +} diff --git a/qt-ui/profile/divetooltipitem.h b/qt-ui/profile/divetooltipitem.h index 1f84d0664..c22287b06 100644 --- a/qt-ui/profile/divetooltipitem.h +++ b/qt-ui/profile/divetooltipitem.h @@ -45,6 +45,7 @@ public: bool isExpanded() const; void persistPos(); void readPos(); + void mousePressEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); void setTimeAxis(DiveCartesianAxis *axis); void setPlotInfo(const plot_info &plot); @@ -64,6 +65,8 @@ private: DiveCartesianAxis *timeAxis; plot_info pInfo; int lastTime; + + QList<QGraphicsItem*> oldSelection; }; #endif // DIVETOOLTIPITEM_H |