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 <Friedemann.Kleint@digia.com>
This commit is contained in:
Giuseppe D'Angelo 2013-08-26 17:54:32 +02:00 committed by The Qt Project
parent b7f7edfae4
commit 198d2f6d3e

View File

@ -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;
}