Commit d37771d7 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Fix QTCREATORBUG-1

Do some focus handling hacks on windows (only)

Reviewed-by: jbache
parent f014f3a4
......@@ -102,6 +102,13 @@ public:
void updatePreferredSize();
QSize preferredSize() const { return m_preferredSize; }
#if defined(Q_OS_WIN)
void focusOutEvent (QFocusEvent * event) {
if (event->reason() == Qt::ActiveWindowFocusReason)
hide();
}
#endif
private:
QSize m_preferredSize;
};
......@@ -249,7 +256,6 @@ void CompletionList::updatePreferredSize()
//header()->setStretchLastSection(true);
}
// =========== LocatorWidget ===========
LocatorWidget::LocatorWidget(LocatorPlugin *qop) :
......@@ -344,7 +350,12 @@ bool LocatorWidget::eventFilter(QObject *obj, QEvent *event)
break;
}
} else if (obj == m_fileLineEdit && event->type() == QEvent::FocusOut) {
m_completionList->hide();
#if defined(Q_OS_WIN)
QFocusEvent *fev = static_cast<QFocusEvent*>(event);
if (fev->reason() != Qt::ActiveWindowFocusReason ||
(fev->reason() == Qt::ActiveWindowFocusReason && !m_completionList->isActiveWindow()))
#endif
m_completionList->hide();
} else if (obj == m_fileLineEdit && event->type() == QEvent::FocusIn) {
showPopup();
} else if (obj == this && event->type() == QEvent::ShortcutOverride) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment