summaryrefslogtreecommitdiff
path: root/src/controls/Private
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/controls/Private
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/controls/Private')
-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
4 files changed, 7 insertions, 8 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