summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-09-20 21:08:26 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-09-30 11:11:39 +0000
commitfdd2fc2c711641b3c3a6a02ad331166cb868fa4c (patch)
tree234ffff984c94182d78efd99133b960a3492f094
parenteb4103e0b9d688d88146e434aa5840f944826f67 (diff)
Remove QKeyMapper::changeKeyboard()
As described in QTBUG-27681, we no longer send KeyboardLayoutChange events in Qt 5 and up. We have QInputMethod::localeChanged, but that doesn't cover the cases where the input language stays the same, but the layout is changed. None of our widgets react to KeyboardLayoutChange these days, but ideally we should send KeyboardLayoutChange if we can plumb it from the platforms. However that plumbing wouldn't live in QKeyMapper, and having it around as dead code doesn't help, so remove it for now, and track the work to implement it in QTBUG-27681. Task-number: QTBUG-27681 Change-Id: I480590550f3bc741b829fb30aa85393b07d5c16f Reviewed-by: Liang Qi <liang.qi@qt.io>
-rw-r--r--src/gui/kernel/qkeymapper.cpp15
-rw-r--r--src/gui/kernel/qkeymapper_p.h1
2 files changed, 0 insertions, 16 deletions
diff --git a/src/gui/kernel/qkeymapper.cpp b/src/gui/kernel/qkeymapper.cpp
index d41f0bfdf3..98fadb988b 100644
--- a/src/gui/kernel/qkeymapper.cpp
+++ b/src/gui/kernel/qkeymapper.cpp
@@ -47,21 +47,6 @@ QList<int> QKeyMapper::possibleKeys(QKeyEvent *e)
return result;
}
-extern bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event); // in qapplication_*.cpp
-void QKeyMapper::changeKeyboard()
-{
- // ## TODO: Support KeyboardLayoutChange on QPA
-#if 0
- // inform all toplevel widgets of the change
- QEvent e(QEvent::KeyboardLayoutChange);
- QWidgetList list = QApplication::topLevelWidgets();
- for (int i = 0; i < list.size(); ++i) {
- QWidget *w = list.at(i);
- qt_sendSpontaneousEvent(w, &e);
- }
-#endif
-}
-
Q_GLOBAL_STATIC(QKeyMapper, keymapper)
/*!
Returns the pointer to the single instance of QKeyMapper in the application.
diff --git a/src/gui/kernel/qkeymapper_p.h b/src/gui/kernel/qkeymapper_p.h
index 2c36bcc5c5..71cb5da2ea 100644
--- a/src/gui/kernel/qkeymapper_p.h
+++ b/src/gui/kernel/qkeymapper_p.h
@@ -33,7 +33,6 @@ public:
~QKeyMapper();
static QKeyMapper *instance();
- static void changeKeyboard();
static QList<int> possibleKeys(QKeyEvent *e);
QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(QKeyMapper)