From 198d2f6d3e1f622e1f168ff7e6aea7d1f05b80ed Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 26 Aug 2013 17:54:32 +0200 Subject: [PATCH] Activate Qt::WidgetWithChildrenShortcut shortcuts in MDI subwindows If a MDI subwindow is focused and an ancestor has a QShortCut set with the Qt::WidgetWithChildrenShortcut flag, it should trigger, as MDI subwindows are not top-level widgets. Task-number: QTBUG-32788 Change-Id: I7ec76d493b827ae6678209a56015ab6b432c1ed9 Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qshortcut.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index 471b054a99..678e6f25d1 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -158,7 +158,7 @@ static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidge if (context == Qt::WidgetWithChildrenShortcut) { const QWidget *tw = QApplication::focusWidget(); - while (tw && tw != w && (tw->windowType() == Qt::Widget || tw->windowType() == Qt::Popup)) + while (tw && tw != w && (tw->windowType() == Qt::Widget || tw->windowType() == Qt::Popup || tw->windowType() == Qt::SubWindow)) tw = tw->parentWidget(); return tw == w; }