Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.9.2, 5.10.0 Beta 4
-
None
-
a79feeee451bcf28673292555795677a789e8513
Description
when a QML scene is embedded in a QQuickWidget and the Shortcut {} element is used, the shortcut won't actually work, because in qquickshortcut.cpp, the matcher does:
static bool qQuickShortcutContextMatcher(QObject *obj, Qt::ShortcutContext context)
{
switch (context) {
case Qt::ApplicationShortcut:
return true;
case Qt::WindowShortcut:
while (obj && !obj->isWindowType()) {
obj = obj->parent();
if (QQuickItem *item = qobject_cast<QQuickItem *>(obj))
obj = item->window();
}
return obj && obj == QGuiApplication::focusWindow();
default:
return false;
}
}
so it will never match as the internal QWindow of a QQuickWidget will never be the qguiapplication's focusWindow
Attachments
Issue Links
- duplicates
-
QTBUG-62990 QML Shortcut does not work with Qt.WindowShortcut with QQuickWidget
- Closed
- is duplicated by
-
QTBUG-64367 Shortcut in QML foes not work with QQuickRenderControl
- Closed
- relates to
-
QTBUG-64367 Shortcut in QML foes not work with QQuickRenderControl
- Closed
For Gerrit Dashboard: QTBUG-64548 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
211659,8 | Add test to QQuickShortcut when render window is used | 5.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
211673,6 | watch for the actual render window if there is a QQuickRenderControl | 5.9 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
211675,4 | watch for the actual render window if there is a QQuickRenderControl | 5.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |