diff options
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | src/import/qtquickvirtualkeyboardplugin.cpp | 3 | ||||
-rw-r--r-- | src/virtualkeyboard/content/components/Keyboard.qml | 38 | ||||
-rw-r--r-- | src/virtualkeyboard/content/components/ShadowInputControl.qml | 2 | ||||
-rw-r--r-- | tests/auto/inputpanel/data/inputpanel/handwritinginputpanel.qml | 4 | ||||
-rw-r--r-- | tests/auto/inputpanel/data/inputpanel/inputpanel.qml | 7 | ||||
-rw-r--r-- | tests/auto/inputpanel/data/tst_inputpanel.qml | 13 |
7 files changed, 43 insertions, 26 deletions
diff --git a/.qmake.conf b/.qmake.conf index f6895bb0..b3c7403c 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,4 +2,4 @@ load(qt_build_config) DEFINES += QT_NO_FOREACH QT_NO_JAVA_STYLE_ITERATORS QT_NO_LINKED_LIST -MODULE_VERSION = 5.14.0 +MODULE_VERSION = 5.15.0 diff --git a/src/import/qtquickvirtualkeyboardplugin.cpp b/src/import/qtquickvirtualkeyboardplugin.cpp index ba866023..ed0ea4a6 100644 --- a/src/import/qtquickvirtualkeyboardplugin.cpp +++ b/src/import/qtquickvirtualkeyboardplugin.cpp @@ -77,7 +77,8 @@ void QtQuickVirtualKeyboardPlugin::registerTypes(const char *uri) qmlRegisterUncreatableType<QVirtualKeyboardAbstractInputMethod>(uri, 2, 0, "AbstractInputMethod", QLatin1String("Cannot create abstract input method")); qmlRegisterType<InputMethod>(uri, 1, 0, "InputMethod"); qmlRegisterType<InputMethod>(uri, 2, 0, "InputMethod"); - qmlRegisterType<EnterKeyActionAttachedType>(); + qmlRegisterAnonymousType<EnterKeyActionAttachedType>(uri, 1); + qmlRegisterAnonymousType<EnterKeyActionAttachedType>(uri, 2); qmlRegisterType<EnterKeyAction>(uri, 1, 0, "EnterKeyAction"); qmlRegisterType<EnterKeyAction>(uri, 2, 0, "EnterKeyAction"); qmlRegisterType<QVirtualKeyboardTrace>(uri, 2, 0, "Trace"); diff --git a/src/virtualkeyboard/content/components/Keyboard.qml b/src/virtualkeyboard/content/components/Keyboard.qml index 1c6f174f..347f1076 100644 --- a/src/virtualkeyboard/content/components/Keyboard.qml +++ b/src/virtualkeyboard/content/components/Keyboard.qml @@ -105,16 +105,16 @@ Item { } Connections { target: VirtualKeyboardSettings - onLocaleChanged: { + function onLocaleChanged() { updateDefaultLocale() localeIndex = defaultLocaleIndex } - onActiveLocalesChanged: { + function onActiveLocalesChanged() { updateDefaultLocale() if (!isValidLocale(localeIndex) || VirtualKeyboardSettings.locale) localeIndex = defaultLocaleIndex } - onFullScreenModeChanged: { + function onFullScreenModeChanged() { wordCandidateView.disableAnimation = VirtualKeyboardSettings.fullScreenMode keyboard.fullScreenMode = VirtualKeyboardSettings.fullScreenMode } @@ -153,23 +153,23 @@ Item { Connections { target: InputContext - onInputMethodHintsChanged: { + function onInputMethodHintsChanged() { if (InputContext.priv.focus) updateInputMethod() } } Connections { target: InputContext.priv - onInputItemChanged: { + function onInputItemChanged() { keyboard.hideLanguagePopup() if (active && symbolMode && !preferNumbers) symbolMode = false } - onFocusChanged: { + function onFocusChanged() { if (InputContext.priv.focus) updateInputMethod() } - onNavigationKeyPressed: { + function onNavigationKeyPressed(key, isAutoRepeat) { var initialKey var direction = wordCandidateView.effectiveLayoutDirection == Qt.LeftToRight ? 1 : -1 switch (key) { @@ -393,7 +393,7 @@ Item { break } } - onNavigationKeyReleased: { + function onNavigationKeyReleased(key, isAutoRepeat) { switch (key) { case Qt.Key_Return: if (!keyboard.navigationModeActive) { @@ -439,7 +439,7 @@ Item { } Connections { target: InputContext.inputEngine - onVirtualKeyClicked: { + function onVirtualKeyClicked(key, text, modifiers, isAutoRepeat) { if (isAutoRepeat && keyboard.activeKey) soundEffect.play(keyboard.activeKey.soundEffect) if (key !== Qt.Key_unknown && keyboardInputArea.dragSymbolMode) { @@ -459,7 +459,7 @@ Item { } Connections { target: layoutsModel - onCountChanged: { + function onCountChanged() { updateDefaultLocale() localeIndex = defaultLocaleIndex } @@ -630,7 +630,7 @@ Item { Connections { target: keyboard - onActiveChanged: { + function onActiveChanged() { if (keyboard.active) shadowInputControlVisibleTimer.start() else @@ -688,9 +688,9 @@ Item { onCurrentItemChanged: if (currentItem) soundEffect.register(currentItem.soundEffect) Connections { target: wordCandidateView.model ? wordCandidateView.model : null - onActiveItemChanged: wordCandidateView.currentIndex = index - onItemSelected: if (wordCandidateView.currentItem) soundEffect.play(wordCandidateView.currentItem.soundEffect) - onCountChanged: { + function onActiveItemChanged(index) { wordCandidateView.currentIndex = index } + function onItemSelected() { if (wordCandidateView.currentItem) soundEffect.play(wordCandidateView.currentItem.soundEffect) } + function onCountChanged() { var empty = wordCandidateView.model.count === 0 if (empty) wordCandidateViewAutoHideTimer.restart() @@ -702,11 +702,11 @@ Item { } Connections { target: InputContext.priv - onInputItemChanged: wordCandidateViewAutoHideTimer.stop() + function onInputItemChanged() { wordCandidateViewAutoHideTimer.stop() } } Connections { target: InputContext.inputEngine - onWordCandidateListVisibleHintChanged: wordCandidateViewAutoHideTimer.stop() + function onWordCandidateListVisibleHintChanged() { wordCandidateViewAutoHideTimer.stop() } } Timer { id: wordCandidateViewAutoHideTimer @@ -757,7 +757,7 @@ Item { Connections { target: VirtualKeyboardSettings - onStyleNameChanged: { + function onStyleNameChanged() { soundEffect.__sounds = {} soundEffect.available = false } @@ -848,7 +848,7 @@ Item { Connections { target: keyboardLayoutLoader - onStatusChanged: { + function onStatusChanged() { if (keyboardLayoutLoader.status == Loader.Ready && keyboard.navigationModeActive && keyboardInputArea.navigationCursor !== Qt.point(-1, -1)) @@ -857,7 +857,7 @@ Item { } Connections { target: keyboard - onNavigationModeActiveChanged: { + function onNavigationModeActiveChanged() { if (!keyboard.navigationModeActive) { keyboardInputArea.navigationCursor = Qt.point(-1, -1) keyboardInputArea.reset() diff --git a/src/virtualkeyboard/content/components/ShadowInputControl.qml b/src/virtualkeyboard/content/components/ShadowInputControl.qml index caa835ea..e3cde2e1 100644 --- a/src/virtualkeyboard/content/components/ShadowInputControl.qml +++ b/src/virtualkeyboard/content/components/ShadowInputControl.qml @@ -90,7 +90,7 @@ Item { selectionColor: keyboard.style.fullScreenInputSelectionColor selectedTextColor: keyboard.style.fullScreenInputSelectedTextColor echoMode: (InputContext.inputMethodHints & Qt.ImhHiddenText) ? TextInput.Password : TextInput.Normal - selectByMouse: true + selectByMouse: !!InputContext.inputItem && !!InputContext.inputItem.selectByMouse onCursorPositionChanged: { cursorSyncTimer.restart() blinkStatus = true diff --git a/tests/auto/inputpanel/data/inputpanel/handwritinginputpanel.qml b/tests/auto/inputpanel/data/inputpanel/handwritinginputpanel.qml index aa7ae714..f3dc4ace 100644 --- a/tests/auto/inputpanel/data/inputpanel/handwritinginputpanel.qml +++ b/tests/auto/inputpanel/data/inputpanel/handwritinginputpanel.qml @@ -47,12 +47,12 @@ HandwritingInputPanel { Connections { target: InputContext - onPreeditTextChanged: if (InputContext.preeditText.length > 0) inputMethodResult(InputContext.preeditText) + function onPreeditTextChanged() { if (InputContext.preeditText.length > 0) inputMethodResult(InputContext.preeditText) } } Connections { target: InputContext.inputEngine - onVirtualKeyClicked: inputMethodResult(text) + function onVirtualKeyClicked(key, text, modifiers, isAutoRepeat) { inputMethodResult(text) } } SignalSpy { diff --git a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml index 62361824..dd46a5b9 100644 --- a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml +++ b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml @@ -101,12 +101,15 @@ InputPanel { Connections { target: InputContext - onPreeditTextChanged: if (InputContext.preeditText.length > 0) inputMethodResult(InputContext.preeditText) + function onPreeditTextChanged() { + if (InputContext.preeditText.length > 0) + inputMethodResult(InputContext.preeditText) + } } Connections { target: InputContext.inputEngine - onVirtualKeyClicked: inputMethodResult(text) + function onVirtualKeyClicked(key, text, modifiers, isAutoRepeat) { inputMethodResult(text) } } SignalSpy { diff --git a/tests/auto/inputpanel/data/tst_inputpanel.qml b/tests/auto/inputpanel/data/tst_inputpanel.qml index ea3394af..d46f29ce 100644 --- a/tests/auto/inputpanel/data/tst_inputpanel.qml +++ b/tests/auto/inputpanel/data/tst_inputpanel.qml @@ -104,6 +104,7 @@ Rectangle { textInput.text = "" } textInput.inputMethodHints = data !== undefined && data.hasOwnProperty("initInputMethodHints") ? data.initInputMethodHints : Qt.ImhNone + textInput.selectByMouse = false handwritingInputPanel.available = false inputPanel.setHandwritingMode(false) textInput.forceActiveFocus() @@ -2080,6 +2081,18 @@ Rectangle { compare(inputPanel.shadowInput.text, "") } + function test_fullScreenModeSelectByMouse() { + prepareTest() + + inputPanel.setFullScreenMode(true) + + // The default value for TextInput/TextEdit is false. + compare(inputPanel.shadowInput.selectByMouse, false) + + textInput.selectByMouse = true + compare(inputPanel.shadowInput.selectByMouse, true) + } + function test_userDictionary_data() { return [ { inputSequence: ['a','s','d','f'], initShift: false }, |