1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00

Clear the popup on scene clear

Fixes #257
This commit is contained in:
Martin Tůma 2019-12-23 16:16:15 +01:00
parent 9a0344adac
commit 05f23de1ed
4 changed files with 16 additions and 0 deletions

View File

@ -46,3 +46,9 @@ void GraphicsScene::helpEvent(QGraphicsSceneHelpEvent *event)
/* No need to process QGraphicsScene::helpEvent() */
}
void GraphicsScene::clear()
{
Popup::clear();
QGraphicsScene::clear();
}

View File

@ -18,6 +18,9 @@ class GraphicsScene : public QGraphicsScene
public:
GraphicsScene(QObject *parent = 0) : QGraphicsScene(parent) {}
public slots:
void clear();
protected:
void helpEvent(QGraphicsSceneHelpEvent *event);

View File

@ -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();
}

View File

@ -9,6 +9,7 @@ class Popup
{
public:
static void show(const QPoint &pos, const QString &text, QWidget *w);
static void clear();
};
#endif // POPUP_H