From 187b61d879129f79da5dbc57805600d5159b1740 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 9 Oct 2012 10:35:19 +0300 Subject: [PATCH] Don't try to emit focusObjectChanged if window pointer is zero Task-number: QTBUG-27414 Change-Id: I75ad662e0a66d61b49d55d084f29cefc98221b7f Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qwidget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index fa055bb210..362a8f4e55 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -5993,8 +5993,10 @@ void QWidget::setFocus(Qt::FocusReason reason) f->d_func()->updateFocusChild(); } - if (QTLWExtra *extra = f->window()->d_func()->maybeTopData()) - emit extra->window->focusObjectChanged(f); + if (QTLWExtra *extra = f->window()->d_func()->maybeTopData()) { + if (extra->window) + emit extra->window->focusObjectChanged(f); + } } // updates focus_child on parent widgets to point into this widget