summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2014-10-17 13:35:09 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2014-10-17 16:10:08 +0200
commit737379ad810d4431a93bed214f50b25632ba00e5 (patch)
tree8535f9b2f8fff7737fa96a363a8e7b72343be2ff /src
parent95ea596beecf25119dc769de1b854414cc27e242 (diff)
downloadqtquickcontrols-737379ad810d4431a93bed214f50b25632ba00e5.tar.gz
Fix TextField & TextArea mouse cursor shape
Mouse cursor shape is specified by an internal MouseArea inside editor. Edit menu was placing another MouseArea on top, so the cursor shape was lost. This change makes EditMenu re-use the same MouseArea. Task-number: QTBUG-41955 Change-Id: I71e38bb42ea20f63b3e15c4c2cc7282b64b10d62 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/controls/Private/EditMenu.qml1
-rw-r--r--src/controls/Private/EditMenu_base.qml6
-rw-r--r--src/controls/Private/EditMenu_ios.qml5
-rw-r--r--src/controls/Private/TextInputWithHandles.qml3
-rw-r--r--src/controls/TextArea.qml4
5 files changed, 10 insertions, 9 deletions
diff --git a/src/controls/Private/EditMenu.qml b/src/controls/Private/EditMenu.qml
index f4d80bd5..0fc9582c 100644
--- a/src/controls/Private/EditMenu.qml
+++ b/src/controls/Private/EditMenu.qml
@@ -49,6 +49,7 @@ Loader {
property Flickable flickable
property Component defaultMenu: item && item.defaultMenu ? item.defaultMenu : null
property Menu menuInstance: null
+ property MouseArea mouseArea
Connections {
target: control
diff --git a/src/controls/Private/EditMenu_base.qml b/src/controls/Private/EditMenu_base.qml
index 597541bc..3745d9f4 100644
--- a/src/controls/Private/EditMenu_base.qml
+++ b/src/controls/Private/EditMenu_base.qml
@@ -90,10 +90,8 @@ Item {
MenuItem { action: pasteAction.createObject(editMenuBase) }
}
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- acceptedButtons: Qt.RightButton
+ Connections {
+ target: mouseArea
onClicked: {
if (input.selectionStart === input.selectionEnd) {
diff --git a/src/controls/Private/EditMenu_ios.qml b/src/controls/Private/EditMenu_ios.qml
index aeb21b03..d2a6c8c0 100644
--- a/src/controls/Private/EditMenu_ios.qml
+++ b/src/controls/Private/EditMenu_ios.qml
@@ -85,9 +85,8 @@ Item {
}
}
- MouseArea {
- id: mouseArea
- anchors.fill: parent
+ Connections {
+ target: mouseArea
function clearFocusFromOtherItems()
{
diff --git a/src/controls/Private/TextInputWithHandles.qml b/src/controls/Private/TextInputWithHandles.qml
index f3348774..5ca81aa1 100644
--- a/src/controls/Private/TextInputWithHandles.qml
+++ b/src/controls/Private/TextInputWithHandles.qml
@@ -104,7 +104,7 @@ TextInput {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.IBeamCursor
- acceptedButtons: input.selectByMouse ? Qt.NoButton : Qt.LeftButton
+ acceptedButtons: (input.selectByMouse ? Qt.NoButton : Qt.LeftButton) | (control.menu ? Qt.RightButton : Qt.NoButton)
onClicked: {
var pos = input.positionAt(mouse.x, mouse.y)
input.moveHandles(pos, pos)
@@ -120,6 +120,7 @@ TextInput {
EditMenu {
id: editMenu
input: parent
+ mouseArea: mouseArea
control: parent.control
cursorHandle: cursorHandle
selectionHandle: selectionHandle
diff --git a/src/controls/TextArea.qml b/src/controls/TextArea.qml
index e1c6a249..844cbff1 100644
--- a/src/controls/TextArea.qml
+++ b/src/controls/TextArea.qml
@@ -846,9 +846,10 @@ ScrollView {
}
MouseArea {
+ id: mouseArea
anchors.fill: parent
cursorShape: edit.hoveredLink ? Qt.PointingHandCursor : Qt.IBeamCursor
- acceptedButtons: edit.selectByMouse ? Qt.NoButton : Qt.LeftButton
+ acceptedButtons: (edit.selectByMouse ? Qt.NoButton : Qt.LeftButton) | (area.menu ? Qt.RightButton : Qt.NoButton)
onClicked: {
var pos = edit.positionAt(mouse.x, mouse.y)
edit.moveHandles(pos, pos)
@@ -865,6 +866,7 @@ ScrollView {
id: editMenu
control: area
input: edit
+ mouseArea: mouseArea
cursorHandle: cursorHandle
selectionHandle: selectionHandle
flickable: flickable