summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/profilewidget2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r--qt-ui/profile/profilewidget2.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 409328918..7a5722082 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -854,12 +854,23 @@ void ProfileWidget2::setProfileState()
mouseFollowerVertical->setVisible(false);
}
+void ProfileWidget2::clearHandlers()
+{
+ if (handles.count()) {
+ foreach (DiveHandler *handle, handles) {
+ scene()->removeItem(handle);
+ }
+ handles.clear();
+ }
+}
+
void ProfileWidget2::setAddState()
{
if (currentState == ADD)
return;
setProfileState();
+ clearHandlers();
mouseFollowerHorizontal->setVisible(true);
mouseFollowerVertical->setVisible(true);
mouseFollowerHorizontal->setLine(timeAxis->line());
@@ -893,6 +904,7 @@ void ProfileWidget2::setPlanState()
return;
setProfileState();
+ clearHandlers();
mouseFollowerHorizontal->setVisible(true);
mouseFollowerVertical->setVisible(true);
mouseFollowerHorizontal->setLine(timeAxis->line());