From fdd2fc2c711641b3c3a6a02ad331166cb868fa4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 20 Sep 2023 21:08:26 +0200 Subject: 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 --- src/gui/kernel/qkeymapper.cpp | 15 --------------- src/gui/kernel/qkeymapper_p.h | 1 - 2 files changed, 16 deletions(-) (limited to 'src/gui/kernel') 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 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 possibleKeys(QKeyEvent *e); QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(QKeyMapper) -- cgit v1.2.3