Skip to content
Snippets Groups Projects
Commit 50e3085f authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Tooltip: Hide when Escape is pressed


Change-Id: Ib516cbbd9b51ddac3dac48668e3341830233af4b
Reviewed-by: default avatarEike Ziller <eike.ziller@qt.io>
parent ac2012a7
No related branches found
No related tags found
No related merge requests found
......@@ -305,9 +305,11 @@ bool ToolTip::eventFilter(QObject *o, QEvent *event)
switch (event->type()) {
case QEvent::KeyPress:
case QEvent::KeyRelease:
case QEvent::KeyRelease: {
int key = static_cast<QKeyEvent *>(event)->key();
if (key == Qt::Key_Escape)
hideTipImmediately();
if (HostOsInfo::isMacHost()) {
int key = static_cast<QKeyEvent *>(event)->key();
Qt::KeyboardModifiers mody = static_cast<QKeyEvent *>(event)->modifiers();
if (!(mody & Qt::KeyboardModifierMask)
&& key != Qt::Key_Shift && key != Qt::Key_Control
......@@ -315,6 +317,7 @@ bool ToolTip::eventFilter(QObject *o, QEvent *event)
hideTipWithDelay();
}
break;
}
case QEvent::Leave:
if (o == m_tip && !m_tip->isAncestorOf(QApplication::focusWidget()))
hideTipWithDelay();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment