From 07f65e7e1150b5487bbf9a268fe652cebb3b7570 Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Tue, 25 Feb 2014 10:01:20 +0100 Subject: Merge updates from upstream into keyboard example Change-Id: I0b48f285e63f88788ca6015a1d7a53edaccd35b8 Reviewed-by: Kalle Viironen --- basicsuite/textinput/TextArea.qml | 6 ------ basicsuite/textinput/TextBase.qml | 4 +++- basicsuite/textinput/TextField.qml | 6 ------ basicsuite/textinput/main.qml | 4 ---- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/basicsuite/textinput/TextArea.qml b/basicsuite/textinput/TextArea.qml index 490e066..6832356 100644 --- a/basicsuite/textinput/TextArea.qml +++ b/basicsuite/textinput/TextArea.qml @@ -77,12 +77,6 @@ TextBase { selectionColor: Qt.rgba(1.0, 1.0, 1.0, 0.5) selectedTextColor: Qt.rgba(0.0, 0.0, 0.0, 0.8) anchors { left: parent.left; right: parent.right; margins: 12 } - cursorDelegate: Rectangle { - width: 2 - opacity: 0.7 - color: "#EEEEEE" - visible: textEdit.activeFocus - } onActiveFocusChanged: if (!activeFocus) deselect() } diff --git a/basicsuite/textinput/TextBase.qml b/basicsuite/textinput/TextBase.qml index 67ee3e3..916b3e2 100644 --- a/basicsuite/textinput/TextBase.qml +++ b/basicsuite/textinput/TextBase.qml @@ -49,7 +49,7 @@ FocusScope { property int fontPixelSize: 32 property string previewText property string enterKeyText - property bool enterKeyEnabled: true + property bool enterKeyEnabled: enterKeyText.length === 0 || editor.text.length > 0 || editor.inputMethodComposing property alias mouseParent: mouseArea.parent implicitHeight: editor.height + 12 @@ -86,6 +86,8 @@ FocusScope { parent: textBase anchors.fill: parent onClicked: { + if (editor.inputMethodComposing) + Qt.inputMethod.commit() var positionInEditor = mapToItem(editor, mouseX, mouseY) var cursorPosition = editor.positionAt(positionInEditor.x, positionInEditor.y) editor.cursorPosition = cursorPosition diff --git a/basicsuite/textinput/TextField.qml b/basicsuite/textinput/TextField.qml index 9b01418..e95ded7 100644 --- a/basicsuite/textinput/TextField.qml +++ b/basicsuite/textinput/TextField.qml @@ -82,12 +82,6 @@ TextBase { selectionColor: Qt.rgba(1.0, 1.0, 1.0, 0.5) selectedTextColor: Qt.rgba(0.0, 0.0, 0.0, 0.8) width: Math.max(flickable.width, implicitWidth)-2 - cursorDelegate: Rectangle { - width: 2 - opacity: 0.7 - color: "#EEEEEE" - visible: textInput.activeFocus - } onActiveFocusChanged: if (!activeFocus) deselect() } } diff --git a/basicsuite/textinput/main.qml b/basicsuite/textinput/main.qml index c6bcda9..2b9caef 100644 --- a/basicsuite/textinput/main.qml +++ b/basicsuite/textinput/main.qml @@ -77,7 +77,6 @@ Flickable { width: parent.width previewText: "One line field" enterKeyText: "Next" - enterKeyEnabled: text.length > 0 onEnterKeyClicked: passwordField.focus = true } TextField { @@ -88,7 +87,6 @@ Flickable { previewText: "Password field" inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhPreferLowercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText enterKeyText: "Next" - enterKeyEnabled: text.length > 0 onEnterKeyClicked: phoneField.focus = true } TextField { @@ -99,7 +97,6 @@ Flickable { previewText: "Phone number field" inputMethodHints: Qt.ImhDialableCharactersOnly enterKeyText: "Next" - enterKeyEnabled: text.length > 0 onEnterKeyClicked: numberField.focus = true } TextField { @@ -110,7 +107,6 @@ Flickable { previewText: "Decimal number field" inputMethodHints: Qt.ImhFormattedNumbersOnly enterKeyText: "Next" - enterKeyEnabled: text.length > 0 onEnterKeyClicked: textArea.focus = true } TextArea { -- cgit v1.2.3