aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/dialogs/qml/TextField.qml
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-03-11 11:05:30 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-18 13:44:38 +0100
commit69186a08270a9c585b19a5140a5fcf52e2bf5bc3 (patch)
treea2d80d8c17a567d9f81ca2216bf37d7e05f874e4 /src/imports/dialogs/qml/TextField.qml
parent7fded5040f56b8def7a93fcce03f93f06bcc6bc4 (diff)
Add ColorDialog to QtQuick.Dialogs
As with FileDialog, it tries QPA, then QColorDialog, and falls back to a QML implementation (which is also provided here) if neither type of native dialog is available. Change-Id: I384928e1f7322bb6b867d4618d07c88c70e3cbfe Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'src/imports/dialogs/qml/TextField.qml')
-rw-r--r--src/imports/dialogs/qml/TextField.qml13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/imports/dialogs/qml/TextField.qml b/src/imports/dialogs/qml/TextField.qml
index 89487e82ca..baa469caa9 100644
--- a/src/imports/dialogs/qml/TextField.qml
+++ b/src/imports/dialogs/qml/TextField.qml
@@ -45,11 +45,20 @@ Item {
property alias textInput: textInput
property alias text: textInput.text
+ property real implicitWidth: textInput.implicitWidth + rect.radius * 2
+ property real implicitHeight: textInput.implicitHeight + rect.radius * 2
signal accepted
signal downPressed
+ function copyAll() {
+ textInput.selectAll()
+ textInput.copy()
+ }
+
SystemPalette { id: palette }
- height: textInput.implicitHeight + 4
+ height: textInput.implicitHeight + 8
+ clip: true
+
Rectangle {
id: rect
anchors.fill: parent
@@ -62,6 +71,8 @@ Item {
id: textInput
color: palette.text
anchors.fill: parent
+ anchors.leftMargin: rect.radius
+ anchors.rightMargin: rect.radius
verticalAlignment: Text.AlignVCenter
onAccepted: root.accepted()
Keys.onDownPressed: root.downPressed()