aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2023-09-03 23:41:17 +0300
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>2023-09-05 10:24:54 +0300
commit2f0565fbdb2683ba336daff9c9e27cf88dff9a0b (patch)
treea2a478c560e8adfd1d417d36d60dea51ef9f8b82 /src
parent7a7944ee102497fcdee4297f6bd6e9012360e2b5 (diff)
Fix binding loop warning emitted by inputpanel test
zh_TW has only two supported input modes Zhuyin and Cangjie. At the time locale is set to zh_TW and the main layout is loaded, inputMode is not yet set to Zhuyin or Cangjie, because the input method is created by the layout and the default input mode is defined by the input method. The binding loop happens, because in the test case the inputMode is Latin during creation: create: inputMode === Latin -> Cangjie default: inputMode === Zhuyin -> Zhuyin test: inputMode === Cangjie -> Cangjie Fix by setting sourceComponent to null if the inputMode is not yet set to supported input mode. Pick-to: 6.5 6.6 Change-Id: I1c9bcccc5655e3ec1553e6e5414b47733eba5b82 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/layouts/zh_TW/main.qml11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/layouts/zh_TW/main.qml b/src/layouts/zh_TW/main.qml
index e9643da3..a839b5dd 100644
--- a/src/layouts/zh_TW/main.qml
+++ b/src/layouts/zh_TW/main.qml
@@ -11,7 +11,16 @@ KeyboardLayoutLoader {
return Qt.createQmlObject('import QtQuick; import QtQuick.VirtualKeyboard.Plugins; TCInputMethod {}', parent, "main.qml")
}
sharedLayouts: ['symbols']
- sourceComponent: InputContext.inputEngine.inputMode === InputEngine.InputMode.Cangjie ? pageCangjie : pageZhuyin
+ sourceComponent: {
+ switch (InputContext.inputEngine.inputMode) {
+ case InputEngine.InputMode.Cangjie:
+ return pageCangjie
+ case InputEngine.InputMode.Zhuyin:
+ return pageZhuyin
+ default:
+ return null
+ }
+ }
Component {
id: pageCangjie
KeyboardLayout {