aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/locator/locatorwidget.cpp
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@digia.com>2013-08-20 17:57:05 +0200
committerDaniel Teske <daniel.teske@digia.com>2013-08-22 15:55:12 +0200
commit3416ecc5942985eda83d0ee02dd10f1d462eee3f (patch)
treed916ea1abae4562286b1a400a85b277775602a6c /src/plugins/locator/locatorwidget.cpp
parentb8bd67236565968c704cb85516e3d984f1425252 (diff)
Locator: Fix locator behavior with qt5
Task-number: QTCREATORBUG-10013 Change-Id: I2bf55cfa2fe1e11bac56cced765789566b659469 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/locator/locatorwidget.cpp')
-rw-r--r--src/plugins/locator/locatorwidget.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/plugins/locator/locatorwidget.cpp b/src/plugins/locator/locatorwidget.cpp
index cc0f4fd788..0ee62c30e9 100644
--- a/src/plugins/locator/locatorwidget.cpp
+++ b/src/plugins/locator/locatorwidget.cpp
@@ -97,12 +97,9 @@ public:
QSize preferredSize() const { return m_preferredSize; }
void focusOutEvent (QFocusEvent * event) {
- if (Utils::HostOsInfo::isWindowsHost()) {
- if (event->reason() == Qt::ActiveWindowFocusReason)
- hide();
- } else {
- QTreeView::focusOutEvent(event);
- }
+ if (event->reason() == Qt::ActiveWindowFocusReason)
+ hide();
+ QTreeView::focusOutEvent(event);
}
void next() {
@@ -400,14 +397,9 @@ bool LocatorWidget::eventFilter(QObject *obj, QEvent *event)
}
}
} else if (obj == m_fileLineEdit && event->type() == QEvent::FocusOut) {
- bool hideList = true;
- if (Utils::HostOsInfo::isWindowsHost()) {
- QFocusEvent *fev = static_cast<QFocusEvent*>(event);
- if (fev->reason() == Qt::ActiveWindowFocusReason &&
- !(fev->reason() == Qt::ActiveWindowFocusReason && !m_completionList->isActiveWindow()))
- hideList = false;
- }
- if (hideList) {
+ QFocusEvent *fev = static_cast<QFocusEvent*>(event);
+ if (fev->reason() != Qt::ActiveWindowFocusReason
+ || (fev->reason() == Qt::ActiveWindowFocusReason && !m_completionList->isActiveWindow())) {
m_completionList->hide();
m_fileLineEdit->clearFocus();
}