diff --git a/src/GUI/graphicsscene.cpp b/src/GUI/graphicsscene.cpp index fa2fa7ad..a51a5754 100644 --- a/src/GUI/graphicsscene.cpp +++ b/src/GUI/graphicsscene.cpp @@ -46,3 +46,9 @@ void GraphicsScene::helpEvent(QGraphicsSceneHelpEvent *event) /* No need to process QGraphicsScene::helpEvent() */ } + +void GraphicsScene::clear() +{ + Popup::clear(); + QGraphicsScene::clear(); +} diff --git a/src/GUI/graphicsscene.h b/src/GUI/graphicsscene.h index 070aa642..e558f0bc 100644 --- a/src/GUI/graphicsscene.h +++ b/src/GUI/graphicsscene.h @@ -18,6 +18,9 @@ class GraphicsScene : public QGraphicsScene public: GraphicsScene(QObject *parent = 0) : QGraphicsScene(parent) {} +public slots: + void clear(); + protected: void helpEvent(QGraphicsSceneHelpEvent *event); diff --git a/src/GUI/popup.cpp b/src/GUI/popup.cpp index 0aaec874..5d500fa6 100644 --- a/src/GUI/popup.cpp +++ b/src/GUI/popup.cpp @@ -163,3 +163,9 @@ void Popup::show(const QPoint &pos, const QString &text, QWidget *w) PopupLabel::_instance->place(pos, w); PopupLabel::_instance->showNormal(); } + +void Popup::clear() +{ + if (PopupLabel::_instance) + PopupLabel::_instance->deleteLater(); +} diff --git a/src/GUI/popup.h b/src/GUI/popup.h index 22d51317..1d132ebe 100644 --- a/src/GUI/popup.h +++ b/src/GUI/popup.h @@ -9,6 +9,7 @@ class Popup { public: static void show(const QPoint &pos, const QString &text, QWidget *w); + static void clear(); }; #endif // POPUP_H