1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-30 22:51:16 +01:00

A much better windows popup close handling

This commit is contained in:
Martin Tůma 2019-10-17 22:02:44 +02:00
parent 5f79326601
commit 4670630e22

View File

@ -35,7 +35,8 @@ private:
Label *Label::_instance = 0;
Label::Label(const QString &text, QWidget *parent)
: QLabel(text, parent, Qt::ToolTip | Qt::BypassGraphicsProxyWidget)
: QLabel(text, parent, Qt::ToolTip | Qt::BypassGraphicsProxyWidget
| Qt::WindowDoesNotAcceptFocus)
{
delete _instance;
_instance = this;
@ -98,18 +99,10 @@ bool Label::eventFilter(QObject *o, QEvent *ev)
}
break;
}
#ifdef Q_OS_WIN32
case QEvent::FocusOut:
case QEvent::WindowDeactivate:
if (o == this)
deleteLater();
break;
#else // Q_OS_WIN32
case QEvent::FocusIn:
case QEvent::FocusOut:
case QEvent::WindowActivate:
case QEvent::WindowDeactivate:
#endif // Q_OS_WIN32
case QEvent::Close:
deleteLater();
break;