Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.9.0 Beta 4
-
None
-
44a5b008f7a6dce065f5997503e403609ee62859
Description
QQuickTextInput handles Key_Space and Key_Backspace etc. as shortcut overrides. Since https://codereview.qt-project.org/#/c/186409/ it no longer receives shortcut override events at all.
#include <QtWidgets> #include <QtQuickWidgets> int main(int argc, char *argv[]) { QApplication app(argc, argv); QMainWindow window; const QList<Qt::Key> keys = {Qt::Key_Space, Qt::Key_Backspace}; for (Qt::Key key : keys) { QShortcut *shortcut = new QShortcut(key, &window); QObject::connect(shortcut, &QShortcut::activated, [=]() { qDebug() << "QShortcut::activated:" << shortcut->key(); }); } QQuickWidget widget; QQmlComponent component(widget.engine()); component.setData("import QtQuick.Controls 2.0; TextField { focus: true; text: 'Press (back)space...' }", QUrl()); widget.setContent(QUrl(), &component, component.create()); window.setCentralWidget(&widget); window.show(); return app.exec(); }
Attachments
Issue Links
- resulted from
-
QTBUG-45757 TableView don't receive KeyEvent with QQuickWidget
- Closed
-
QTBUG-60983 Menu actions are triggered despite a modal dialog being open
- Closed