Clear focus if the widget being deleted is the parent's focus child.

If a widget is deleted as a result of a window activation changed then
it is possible that the parent does not clear the focus because of the
activation change. If the focus child is actually part of an embedded
widget in the graphicsview then it needs to be handled explicitly in
this case too.

Change-Id: I3e7a2b963f175828de4c19283178560abca91235
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
This commit is contained in:
Andy Shaw 2013-07-04 19:59:56 +02:00 committed by The Qt Project
parent d9ea4bb144
commit 22fbb5be6e

View File

@ -1401,7 +1401,7 @@ QWidget::~QWidget()
w = w->d_func()->extra->focus_proxy;
QWidget *window = w->window();
QWExtra *e = window ? window->d_func()->extra : 0;
if (!e || !e->proxyWidget)
if (!e || !e->proxyWidget || (w->parentWidget() && w->parentWidget()->d_func()->focus_child == this))
#endif
clearFocus();
} QT_CATCH(...) {