summaryrefslogtreecommitdiffstats
path: root/demos/declarative/webbrowser/fieldtext/FieldText.qml
diff options
context:
space:
mode:
Diffstat (limited to 'demos/declarative/webbrowser/fieldtext/FieldText.qml')
-rw-r--r--demos/declarative/webbrowser/fieldtext/FieldText.qml28
1 files changed, 7 insertions, 21 deletions
diff --git a/demos/declarative/webbrowser/fieldtext/FieldText.qml b/demos/declarative/webbrowser/fieldtext/FieldText.qml
index d822d65..3a9abdf 100644
--- a/demos/declarative/webbrowser/fieldtext/FieldText.qml
+++ b/demos/declarative/webbrowser/fieldtext/FieldText.qml
@@ -17,7 +17,6 @@ Item {
if (!mouseGrabbed) {
fieldText.startEdit();
fieldText.state='editing';
- textEdit.selectAll();
mouseGrabbed=true;
}
}
@@ -61,7 +60,7 @@ Item {
opacity: 0
}
- TextEdit {
+ LineEdit {
id: textEdit
text: fieldText.text
focus: false
@@ -73,7 +72,9 @@ Item {
color: "black"
font.bold: true
readOnly: true
- wrap: false
+ Keys.onEnterPressed: confirm()
+ Keys.onReturnPressed: confirm()
+ Keys.onEscapePressed: reset()
}
Text {
@@ -95,20 +96,6 @@ Item {
}
}
- KeyProxy {
- id: proxy
- focus: false
- anchors.fill: parent
- targets: [keyActions,textEdit]
- }
-
- Item {
- id: keyActions
- Keys.onEnterPressed: confirm()
- Keys.onReturnPressed: confirm()
- Keys.onEscapePressed: reset()
- }
-
MouseRegion {
anchors.fill: cancelIcon
onClicked: { reset() }
@@ -140,6 +127,9 @@ Item {
target: textEdit
color: "black"
readOnly: false
+ focus: true
+ selectionStart: 0
+ selectionEnd: -1
}
SetProperties {
target: editRegion
@@ -153,10 +143,6 @@ Item {
target: textEdit.anchors
rightMargin: 34
}
- SetProperties {
- target: proxy
- focus: true
- }
}
]