forked from qt-creator/qt-creator
Utils: Hide tooltip if application becomes inactive
Switching to another application with "Alt+Tab" was working fine here - the tooltip closed as expected. But switching by clicking on another application window lead to a left over tooltip. Tested with openbox 3.6 window manager. Task-number: QTCREATORBUG-13397 Change-Id: Id92f6df3b63256a962591df2912a0819fc777073 Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -48,6 +48,13 @@ 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()
|
||||
|
||||
Reference in New Issue
Block a user