diff options
author | Andy Shaw <andy.shaw@qt.io> | 2016-11-18 15:44:06 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2016-11-23 13:54:53 +0000 |
commit | 1ba0613309439f778b4b4e955131d80936490371 (patch) | |
tree | 80db4e27ea912d3b65f4d2f66e2394efc0617898 | |
parent | c8d177387ead0b01badf7329beaf38a3950be90b (diff) |
Use the QLocale's decimal point setting for the digipad
Change-Id: I8a42546e1a520886f2dab417d9ae43037f1d7012
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | src/virtualkeyboard/content/layouts/en_GB/digits.qml | 6 | ||||
-rw-r--r-- | tests/auto/inputpanel/data/tst_inputpanel.qml | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/virtualkeyboard/content/layouts/en_GB/digits.qml b/src/virtualkeyboard/content/layouts/en_GB/digits.qml index 16eb1be8..5a59d3f3 100644 --- a/src/virtualkeyboard/content/layouts/en_GB/digits.qml +++ b/src/virtualkeyboard/content/layouts/en_GB/digits.qml @@ -100,8 +100,10 @@ KeyboardLayout { text: "0" } Key { - key: Qt.Key_Period - text: "." + // The decimal key, if it is not "," then we fallback to + // "." in case it is an unhandled different result + key: Qt.locale().decimalPoint === "," ? Qt.Key_Comma : Qt.Key_Period + text: Qt.locale().decimalPoint === "," ? "," : "." } EnterKey {} } diff --git a/tests/auto/inputpanel/data/tst_inputpanel.qml b/tests/auto/inputpanel/data/tst_inputpanel.qml index 4c5c8879..335f23e5 100644 --- a/tests/auto/inputpanel/data/tst_inputpanel.qml +++ b/tests/auto/inputpanel/data/tst_inputpanel.qml @@ -327,10 +327,11 @@ Rectangle { } function test_inputMethodHints_data() { + var decmialPoint = Qt.locale().decimalPoint return [ { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhUppercaseOnly, inputSequence: "uppercase text? yes.", outputText: "UPPERCASE TEXT? YES." }, { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhLowercaseOnly, inputSequence: "uppercase text? no.", outputText: "uppercase text? no." }, - { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhDigitsOnly, inputSequence: "1234567890.", outputText: "1234567890." }, + { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhDigitsOnly, inputSequence: "1234567890" + decmialPoint, outputText: "1234567890" + decmialPoint }, { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhFormattedNumbersOnly, inputSequence: "1234567890+-,.()", outputText: "1234567890+-,.()" }, { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhDialableCharactersOnly, inputSequence: "1234567890+*#", outputText: "1234567890+*#" }, ] |