From f6169ae4b11cad245ce244a474cad6d570be357a Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 31 Jul 2012 11:43:15 +0200 Subject: [PATCH] fix QWidget::activateWindow for child widgets For child widgets we must use the windowHandle of the toplevel widget. Change-Id: If7bad8ed4bba694806a2c8b77bae3d25cc200b8b Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qwidget_qpa.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 5b3155fbc0..f03d2bd204 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -439,8 +439,10 @@ QWidget *QWidget::keyboardGrabber() void QWidget::activateWindow() { - if (windowHandle()) - windowHandle()->requestActivateWindow(); + QWindow *const wnd = window()->windowHandle(); + + if (wnd) + wnd->requestActivateWindow(); } // Position top level windows at the center, avoid showing