Commit 9e1d58e4 authored by Eike Ziller's avatar Eike Ziller

Don't change context if focus widget parent hierarchy doesn't define one

We now keep the current context if the focus is set on a widget with a
parent hierarchy that doesn't define one. This way, toplevels without a
context, like popup windows without parent, will keep the behavior from
before other toplevels could define contexts at all
(2118d542)

Task-number: QTCREATORBUG-8667
Change-Id: I8dd04d1f97f6ced10f8fa4269bc91457211396ca
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent 9f5a987f
......@@ -1128,7 +1128,10 @@ void MainWindow::updateFocusWidget(QWidget *old, QWidget *now)
p = p->parentWidget();
}
}
updateContextObject(newContext);
// ignore toplevels that define no context, like popups without parent
if (newContext || qApp->focusWidget() == focusWidget())
updateContextObject(newContext);
}
void MainWindow::updateContextObject(IContext *context)
......
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