mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
A much better windows popup close handling
This commit is contained in:
parent
5f79326601
commit
4670630e22
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user