summaryrefslogtreecommitdiff
path: root/src/controls/ComboBox.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2014-07-18 08:39:12 +0200
committerJ-P Nurmi <jpnurmi@digia.com>2014-07-18 17:37:55 +0200
commit8a13f087d3c0c7b9010b9861890b27a17889aeaa (patch)
treefab8ac15c7b59b2d2df18f985b8e4948c234ccc1 /src/controls/ComboBox.qml
parent15d7ab65d1b8772a68258573141874d7f5cd2be5 (diff)
downloadqtquickcontrols-8a13f087d3c0c7b9010b9861890b27a17889aeaa.tar.gz
ComboBox: add support for selection handles
Task-number: QTBUG-38934 Change-Id: I0d7bfc821ff345e76d1ae89818f6a5e0120695f5 Reviewed-by: Liang Qi <liang.qi@digia.com>
Diffstat (limited to 'src/controls/ComboBox.qml')
-rw-r--r--src/controls/ComboBox.qml28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml
index 51694e73..768077a9 100644
--- a/src/controls/ComboBox.qml
+++ b/src/controls/ComboBox.qml
@@ -162,7 +162,7 @@ Control {
This property indicates whether the control is being hovered.
*/
- readonly property bool hovered: mouseArea.containsMouse || cursorArea.containsMouse
+ readonly property bool hovered: mouseArea.containsMouse || input.containsMouse
/*! \qmlproperty int ComboBox::count
\since QtQuick.Controls 1.1
@@ -238,6 +238,17 @@ Control {
readonly property alias acceptableInput: input.acceptableInput
/*!
+ \qmlproperty bool ComboBox::selectByMouse
+ \since QtQuick.Controls 1.3
+
+ This property determines if the user can select the text in
+ the editable text field with the mouse.
+
+ The default value is \c true.
+ */
+ property bool selectByMouse: true
+
+ /*!
\qmlproperty bool ComboBox::inputMethodComposing
\since QtQuick.Controls 1.3
@@ -370,7 +381,7 @@ Control {
}
}
- TextInput {
+ TextInputWithHandles {
id: input
visible: editable
@@ -378,6 +389,10 @@ Control {
focus: true
clip: contentWidth > width
+ control: comboBox
+ cursorHandle: __style ? __style.cursorHandle : undefined
+ selectionHandle: __style ? __style.selectionHandle : undefined
+
anchors.fill: parent
anchors.leftMargin: 8
anchors.rightMargin: __panel.dropDownButtonWidth + __style.padding.right
@@ -386,7 +401,6 @@ Control {
font: __panel && __panel.font !== undefined ? __panel.font : TextSingleton.font
renderType: __style ? __style.renderType : Text.NativeRendering
- selectByMouse: true
color: __panel ? __panel.textColor : "black"
selectionColor: __panel ? __panel.selectionColor : "blue"
selectedTextColor: __panel ? __panel.selectedTextColor : "white"
@@ -474,14 +488,6 @@ Control {
}
prevText = text
}
-
- MouseArea {
- id: cursorArea
- anchors.fill: parent
- hoverEnabled: true
- cursorShape: Qt.IBeamCursor
- acceptedButtons: Qt.NoButton
- }
}
Binding {