aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/inputpanel/data/tst_inputpanel.qml
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2017-09-21 23:28:23 +0300
committerMitch Curtis <mitch.curtis@qt.io>2018-01-19 09:40:22 +0000
commit46f6b84e7e8d5cff6e038d47026baf657ecb1460 (patch)
treeb5a0fd8a5a8f149244011026956b274f914ddac5 /tests/auto/inputpanel/data/tst_inputpanel.qml
parentd297dfd0641e6608386205d99a0518726c315867 (diff)
Add support for external language switch
Added new signal InputPanel::externalLanguageSwitch and a property InputPanel::externalLanguageSwitchEnabled for enabling external language switch. If the externalLanguageSwitchEnabled is true, the signal is triggered instead of built-in language popup. The new language can be selected by setting the VirtualKeyboardSettings::locale property. [ChangeLog] Add option to use external language dialog instead of built-in language popup. Change-Id: I44f88e6b3e52db4cfbee02bd3b6d7f4be38a9521 Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/inputpanel/data/tst_inputpanel.qml')
-rw-r--r--tests/auto/inputpanel/data/tst_inputpanel.qml16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/auto/inputpanel/data/tst_inputpanel.qml b/tests/auto/inputpanel/data/tst_inputpanel.qml
index 61d6f509..f9164f97 100644
--- a/tests/auto/inputpanel/data/tst_inputpanel.qml
+++ b/tests/auto/inputpanel/data/tst_inputpanel.qml
@@ -82,6 +82,7 @@ Rectangle {
inputPanel.setWclAlwaysVisible(data !== undefined && data.hasOwnProperty("wclAlwaysVisible") && data.wclAlwaysVisible)
inputPanel.setWclAutoCommitWord(data !== undefined && data.hasOwnProperty("wclAutoCommitWord") && data.wclAutoCommitWord)
inputPanel.setFullScreenMode(data !== undefined && data.hasOwnProperty("fullScreenMode") && data.fullScreenMode)
+ inputPanel.setExternalLanguageSwitchEnabled(data !== undefined && data.hasOwnProperty("externalLanguageSwitchEnabled") && data.externalLanguageSwitchEnabled)
container.forceActiveFocus()
if (data !== undefined && data.hasOwnProperty("initText")) {
textInput.text = data.initText
@@ -1527,14 +1528,23 @@ Rectangle {
}
}
- function test_languagePopupListToggle() {
- prepareTest()
+ function test_languagePopupListToggle_data() {
+ return [
+ { externalLanguageSwitchEnabled: true },
+ { externalLanguageSwitchEnabled: false },
+ ]
+ }
+
+ function test_languagePopupListToggle(data) {
+ prepareTest(data)
if (inputPanel.availableLocales.length < 2)
skip("Input language can not be changed")
var changeLanguageKey = inputPanel.findObjectByName("changeLanguageKey")
var languagePopupList = inputPanel.findObjectByName("languagePopupList")
+ inputPanel.externalLanguageSwitchSpy.clear()
inputPanel.virtualKeyClick(changeLanguageKey)
- compare(languagePopupList.visible, true)
+ compare(languagePopupList.visible, !data.externalLanguageSwitchEnabled)
+ compare(inputPanel.externalLanguageSwitchSpy.count, data.externalLanguageSwitchEnabled ? 1 : 0)
inputPanel.virtualKeyClick(changeLanguageKey)
compare(languagePopupList.visible, false)
}