diff options
Diffstat (limited to 'tests/auto/inputpanel/data/tst_inputpanel.qml')
-rw-r--r-- | tests/auto/inputpanel/data/tst_inputpanel.qml | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/auto/inputpanel/data/tst_inputpanel.qml b/tests/auto/inputpanel/data/tst_inputpanel.qml index 4c5c8879..915d7441 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+*#" }, ] @@ -383,6 +384,27 @@ Rectangle { compare(textInput.text, data.outputText) } + function test_focusAndShiftState() { + prepareTest() + + // Initial focus is set to textInput, shift state should not change + // when focus is set to container + inputPanel.shiftStateSpy.clear() + container.forceActiveFocus() + compare(inputPanel.shiftStateSpy.count, 0, "Unexpected number of shift state changes after focus change (ImhNone -> ImhNone)") + + // Change to lower case + inputPanel.shiftStateSpy.clear() + inputPanel.toggleShift() + compare(inputPanel.shiftStateSpy.count, 1, "Unexpected number of shift state changes after shift key press") + + // Set focus back to textInput, and expect that shift state is changed + // to auto upper case + inputPanel.shiftStateSpy.clear() + textInput.forceActiveFocus() + compare(inputPanel.shiftStateSpy.count, 1, "Unexpected number of shift state changes after focus change (auto upper case)") + } + function test_symbolMode() { prepareTest({ initInputMethodHints: Qt.ImhNoPredictiveText }) |