From 22fbb5be6edd1b128d582f68c095ff5118dadc29 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 4 Jul 2013 19:59:56 +0200 Subject: [PATCH] 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 Reviewed-by: Andreas Aardal Hanssen --- src/widgets/kernel/qwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 7cb0979c06c..49d64c5cd88 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -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(...) {