Clear specific QWindow::focusObject() on QWindowPrivate::clearFocusObject()
The focusObject of a QWidgetWindow is the focusWidget() of the top level widget, so when clearing the focus object of the window we should clear focus of the same focusWidget, not the application-wide focus widget, which may live in another window. Change-Id: Ib9162418865c225e23aac7987e119b3b651983eb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
This commit is contained in:
parent
3ab4e869e2
commit
0f98d36ff6
@ -73,8 +73,10 @@ public:
|
||||
|
||||
void clearFocusObject()
|
||||
{
|
||||
if (QApplicationPrivate::focus_widget)
|
||||
QApplicationPrivate::focus_widget->clearFocus();
|
||||
Q_Q(QWidgetWindow);
|
||||
QWidget *widget = q->widget();
|
||||
if (widget && widget->focusWidget())
|
||||
widget->focusWidget()->clearFocus();
|
||||
}
|
||||
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user