forked from qt-creator/qt-creator
Locator: Fix locator behavior with qt5
Task-number: QTCREATORBUG-10013 Change-Id: I2bf55cfa2fe1e11bac56cced765789566b659469 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -97,12 +97,9 @@ public:
|
|||||||
QSize preferredSize() const { return m_preferredSize; }
|
QSize preferredSize() const { return m_preferredSize; }
|
||||||
|
|
||||||
void focusOutEvent (QFocusEvent * event) {
|
void focusOutEvent (QFocusEvent * event) {
|
||||||
if (Utils::HostOsInfo::isWindowsHost()) {
|
if (event->reason() == Qt::ActiveWindowFocusReason)
|
||||||
if (event->reason() == Qt::ActiveWindowFocusReason)
|
hide();
|
||||||
hide();
|
QTreeView::focusOutEvent(event);
|
||||||
} else {
|
|
||||||
QTreeView::focusOutEvent(event);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void next() {
|
void next() {
|
||||||
@@ -400,14 +397,9 @@ bool LocatorWidget::eventFilter(QObject *obj, QEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (obj == m_fileLineEdit && event->type() == QEvent::FocusOut) {
|
} else if (obj == m_fileLineEdit && event->type() == QEvent::FocusOut) {
|
||||||
bool hideList = true;
|
QFocusEvent *fev = static_cast<QFocusEvent*>(event);
|
||||||
if (Utils::HostOsInfo::isWindowsHost()) {
|
if (fev->reason() != Qt::ActiveWindowFocusReason
|
||||||
QFocusEvent *fev = static_cast<QFocusEvent*>(event);
|
|| (fev->reason() == Qt::ActiveWindowFocusReason && !m_completionList->isActiveWindow())) {
|
||||||
if (fev->reason() == Qt::ActiveWindowFocusReason &&
|
|
||||||
!(fev->reason() == Qt::ActiveWindowFocusReason && !m_completionList->isActiveWindow()))
|
|
||||||
hideList = false;
|
|
||||||
}
|
|
||||||
if (hideList) {
|
|
||||||
m_completionList->hide();
|
m_completionList->hide();
|
||||||
m_fileLineEdit->clearFocus();
|
m_fileLineEdit->clearFocus();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user