diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-06-24 16:09:49 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-25 09:29:24 +0200 |
commit | 6811920dea2e864dc2b7231c18c8b72af5cab7f5 (patch) | |
tree | 7dff6b73c0c00f8cd824308666ffc1289c6e7275 /src/widgets | |
parent | 63601509f89f250b7768f79d42b22f95eb1b4c4c (diff) |
Fix QWidget::isActiveWindow for window containers.
Change-Id: If0e8b83d7dc84b66f4ce5a5cd98affa4bd9b7424
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index cfccce7c41..1c4ae9c8a2 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -104,6 +104,8 @@ #include "qtabwidget.h" // Needed in inTabWidget() #endif // QT_KEYPAD_NAVIGATION +#include "qwindowcontainer_p.h" + // widget/widget data creation count //#define QWIDGET_EXTRA_DEBUG @@ -6249,6 +6251,17 @@ bool QWidget::isActiveWindow() const } } + // Check for an active window container + if (QWindow *ww = QGuiApplication::focusWindow()) { + while (ww) { + QWidgetWindow *qww = qobject_cast<QWidgetWindow *>(ww); + QWindowContainer *qwc = qww ? qobject_cast<QWindowContainer *>(qww->widget()) : 0; + if (qwc && qwc->topLevelWidget() == tlw) + return true; + ww = ww->parent(); + } + } + // Check if platform adaptation thinks the window is active. This is necessary for // example in case of ActiveQt servers that are embedded into another application. // Those are separate processes that are not part of the parent application Qt window/widget |