forked from qt-creator/qt-creator
Fix hiding tooltips on windows.
basically an rewrite of commit c47e52c97b.
Task-number: QTCREATORBUG-15882
Change-Id: I711f99ed0ae1d1859d5ef5cbd2128215a10b7ed4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -48,13 +48,6 @@ ToolTip::ToolTip() : m_tip(0), m_widget(0)
|
||||
{
|
||||
connect(&m_showTimer, &QTimer::timeout, this, &ToolTip::hideTipImmediately);
|
||||
connect(&m_hideDelayTimer, &QTimer::timeout, this, &ToolTip::hideTipImmediately);
|
||||
connect(static_cast<QGuiApplication *>(QGuiApplication::instance()),
|
||||
&QGuiApplication::applicationStateChanged,
|
||||
[this](Qt::ApplicationState state) {
|
||||
if (state != Qt::ApplicationActive)
|
||||
hideTipImmediately();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
ToolTip::~ToolTip()
|
||||
@@ -290,6 +283,11 @@ void ToolTip::placeTip(const QPoint &pos, QWidget *w)
|
||||
|
||||
bool ToolTip::eventFilter(QObject *o, QEvent *event)
|
||||
{
|
||||
if (m_tip && event->type() == QEvent::ApplicationStateChange
|
||||
&& qApp->applicationState() != Qt::ApplicationActive) {
|
||||
hideTipImmediately();
|
||||
}
|
||||
|
||||
if (!o->isWidgetType())
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user