diff options
Diffstat (limited to 'src/controls/TextField.qml')
| -rw-r--r-- | src/controls/TextField.qml | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/src/controls/TextField.qml b/src/controls/TextField.qml index 58498f13e..797c3fc28 100644 --- a/src/controls/TextField.qml +++ b/src/controls/TextField.qml @@ -137,6 +137,14 @@ Control { property alias cursorPosition: textInput.cursorPosition /*! + \qmlproperty rect TextField::cursorRectangle + \since QtQuick.Controls 1.3 + + The rectangle where the text cursor is rendered within the text field. + */ + readonly property alias cursorRectangle: textInput.cursorRectangle + + /*! \qmlproperty string TextField::displayText This property holds the text displayed in the TextField. @@ -236,6 +244,18 @@ Control { property alias inputMask: textInput.inputMask /*! + \qmlproperty bool TextField::inputMethodComposing + \since QtQuick.Controls 1.3 + + This property holds whether the TextField has partial text input from an input method. + + While it is composing an input method may rely on mouse or key events from the TextField + to edit or commit the partial text. This property can be used to determine when to disable + events handlers that may interfere with the correct operation of an input method. + */ + readonly property bool inputMethodComposing: !!textInput.inputMethodComposing + + /*! \qmlproperty enumeration TextField::inputMethodHints Provides hints to the input method about the expected content of the @@ -331,6 +351,17 @@ Control { Accessible.readOnly: readOnly /*! + \qmlproperty bool TextField::selectByMouse + \since QtQuick.Controls 1.3 + + This property determines if the user can select the text with the + mouse. + + The default value is \c true. + */ + property bool selectByMouse: true + + /*! \qmlproperty string TextField::selectedText Provides the text currently selected in the text input. @@ -553,7 +584,7 @@ Control { This property holds whether the control is being hovered. */ - readonly property alias hovered: mouseArea.containsMouse + readonly property alias hovered: textInput.containsMouse /*! \internal */ property alias __contentHeight: textInput.contentHeight @@ -572,14 +603,6 @@ Control { Accessible.role: Accessible.EditableText Accessible.description: placeholderText - MouseArea { - id: mouseArea - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.IBeamCursor - onClicked: textfield.forceActiveFocus() - } - Text { id: placeholderTextComponent anchors.fill: textInput @@ -591,16 +614,18 @@ Control { clip: contentWidth > width; elide: Text.ElideRight renderType: __style ? __style.renderType : Text.NativeRendering - Behavior on opacity { NumberAnimation { duration: 90 } } } - TextInput { + TextInputWithHandles { id: textInput focus: true - selectByMouse: Qt.platform.os !== "android" // Workaround for QTBUG-36515 selectionColor: __panel ? __panel.selectionColor : "darkred" selectedTextColor: __panel ? __panel.selectedTextColor : "white" + control: textfield + cursorHandle: __style ? __style.cursorHandle : undefined + selectionHandle: __style ? __style.selectionHandle : undefined + font: __panel ? __panel.font : TextSingleton.font anchors.leftMargin: __panel ? __panel.leftMargin : 0 anchors.topMargin: __panel ? __panel.topMargin : 0 |
