diff options
Diffstat (limited to 'tests/auto/quick/qquickmousearea/data')
12 files changed, 101 insertions, 15 deletions
diff --git a/tests/auto/quick/qquickmousearea/data/clickThrough2.qml b/tests/auto/quick/qquickmousearea/data/clickThrough2.qml index 2624108225..4e87b4eeb5 100644 --- a/tests/auto/quick/qquickmousearea/data/clickThrough2.qml +++ b/tests/auto/quick/qquickmousearea/data/clickThrough2.qml @@ -28,8 +28,8 @@ Item{ enabled: true anchors.fill: parent propagateComposedEvents: !noPropagation - onClicked: mouse.accepted = !letThrough; - onDoubleClicked: mouse.accepted = !letThrough; - onPressAndHold: mouse.accepted = !letThrough; + onClicked: function (mouse) { mouse.accepted = !letThrough; } + onDoubleClicked: function (mouse) { mouse.accepted = !letThrough; } + onPressAndHold: function (mouse) { mouse.accepted = !letThrough; } } } diff --git a/tests/auto/quick/qquickmousearea/data/containsMouseAndHoverDisabled.qml b/tests/auto/quick/qquickmousearea/data/containsMouseAndHoverDisabled.qml new file mode 100644 index 0000000000..d98ef85c55 --- /dev/null +++ b/tests/auto/quick/qquickmousearea/data/containsMouseAndHoverDisabled.qml @@ -0,0 +1,15 @@ +import QtQuick + +Rectangle { + width: 200 + height: 200 + visible: true + MouseArea { + id: mouseArea + objectName: "mouseArea" + anchors.fill: parent + hoverEnabled: false + onPressed: function(mouse) { mouse.accepted = false } + } +} + diff --git a/tests/auto/quick/qquickmousearea/data/cursorUpdating.qml b/tests/auto/quick/qquickmousearea/data/cursorUpdating.qml new file mode 100644 index 0000000000..2d06543c78 --- /dev/null +++ b/tests/auto/quick/qquickmousearea/data/cursorUpdating.qml @@ -0,0 +1,71 @@ +import QtQuick + +Item { + width: 600 + height: 600 + + ListModel { + id: cursorsModel + ListElement { cursorShape: Qt.ArrowCursor; text: "Arrow" } + ListElement { cursorShape: Qt.UpArrowCursor; text: "UpArrow" } + ListElement { cursorShape: Qt.CrossCursor; text: "Cross" } + ListElement { cursorShape: Qt.WaitCursor; text: "Wait" } + ListElement { cursorShape: Qt.IBeamCursor; text: "IBeam" } + ListElement { cursorShape: Qt.SizeVerCursor; text: "SizeVer" } + ListElement { cursorShape: Qt.SizeHorCursor; text: "SizeHor" } + ListElement { cursorShape: Qt.SizeBDiagCursor; text: "SizeBDiag" } + ListElement { cursorShape: Qt.SizeFDiagCursor; text: "SizeFDiag" } + ListElement { cursorShape: Qt.SizeAllCursor; text: "SizeAll" } + ListElement { cursorShape: Qt.BlankCursor; text: "Blank" } + ListElement { cursorShape: Qt.SplitVCursor; text: "SplitV" } + ListElement { cursorShape: Qt.SplitHCursor; text: "SplitH" } + ListElement { cursorShape: Qt.PointingHandCursor; text: "PointingHand" } + ListElement { cursorShape: Qt.ForbiddenCursor; text: "Forbidden" } + ListElement { cursorShape: Qt.WhatsThisCursor; text: "WhatsThis" } + ListElement { cursorShape: Qt.BusyCursor; text: "Busy" } + ListElement { cursorShape: Qt.OpenHandCursor; text: "OpenHand" } + ListElement { cursorShape: Qt.ClosedHandCursor; text: "ClosedHand" } + ListElement { cursorShape: Qt.DragCopyCursor; text: "DragCopy" } + ListElement { cursorShape: Qt.DragMoveCursor; text: "DragMove" } + ListElement { cursorShape: Qt.DragLinkCursor; text: "DragLink" } + } + + Flickable { + anchors.fill: parent + contentHeight: flow.height + Flow { + id: flow + width: parent.width + Repeater { + model: cursorsModel + Rectangle { + id: root + color: "white" + border.width: 5 + border.color: "black" + + width: 200 + height: 200 + + Text { + id: textItem + anchors.fill: parent + anchors.margins: parent.width * 0.1 + text: model.text + fontSizeMode: Text.Fit + minimumPixelSize: 10; font.pixelSize: height + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + } + + MouseArea { + id: mouseArea + anchors.fill: parent + hoverEnabled: true + cursorShape: model.cursorShape + } + } + } + } + } +} diff --git a/tests/auto/quick/qquickmousearea/data/hoverAfterPress.qml b/tests/auto/quick/qquickmousearea/data/hoverAfterPress.qml index 69ec8fbd47..97512d1106 100644 --- a/tests/auto/quick/qquickmousearea/data/hoverAfterPress.qml +++ b/tests/auto/quick/qquickmousearea/data/hoverAfterPress.qml @@ -16,7 +16,7 @@ Item { objectName: "mouseArea" anchors.fill: parent hoverEnabled: true - onPressed: mouse.accepted = false + onPressed: function (mouse) { mouse.accepted = false } //onContainsMouseChanged: print("containsMouse changed =", containsMouse) Rectangle { diff --git a/tests/auto/quick/qquickmousearea/data/ignoreBySource.qml b/tests/auto/quick/qquickmousearea/data/ignoreBySource.qml index a53cbf7b1d..bb20a317f7 100644 --- a/tests/auto/quick/qquickmousearea/data/ignoreBySource.qml +++ b/tests/auto/quick/qquickmousearea/data/ignoreBySource.qml @@ -21,7 +21,7 @@ Item { MouseArea { id: ma objectName: "mousearea" - onPressed: { + onPressed: function (mouse) { root.lastEventSource = mouse.source if (mouse.source !== root.allowedSource) mouse.accepted = false diff --git a/tests/auto/quick/qquickmousearea/data/mask.qml b/tests/auto/quick/qquickmousearea/data/mask.qml index 1e8ae7c98a..ab8ecbf32d 100644 --- a/tests/auto/quick/qquickmousearea/data/mask.qml +++ b/tests/auto/quick/qquickmousearea/data/mask.qml @@ -1,5 +1,5 @@ // Copyright (C) 2017 Ford Motor Company -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.11 import Test 1.0 diff --git a/tests/auto/quick/qquickmousearea/data/moveAndReleaseWithoutPress.qml b/tests/auto/quick/qquickmousearea/data/moveAndReleaseWithoutPress.qml index 6c68f0c7c8..4b7324a98a 100644 --- a/tests/auto/quick/qquickmousearea/data/moveAndReleaseWithoutPress.qml +++ b/tests/auto/quick/qquickmousearea/data/moveAndReleaseWithoutPress.qml @@ -7,7 +7,7 @@ MouseArea { property bool hadMove: false property bool hadRelease: false - onPressed: mouse.accepted = false + onPressed: function (mouse) { mouse.accepted = false } onPositionChanged: hadMove = true onReleased: hadRelease = true } diff --git a/tests/auto/quick/qquickmousearea/data/qtbug34368.qml b/tests/auto/quick/qquickmousearea/data/qtbug34368.qml index 42d8ddd3b6..96e72a8edc 100644 --- a/tests/auto/quick/qquickmousearea/data/qtbug34368.qml +++ b/tests/auto/quick/qquickmousearea/data/qtbug34368.qml @@ -12,7 +12,7 @@ Rectangle { anchors.fill: parent propagateComposedEvents: true z: 1 - onClicked: { + onClicked: function (mouse) { mouse.accepted = false; clicksEnabled += 1; //console.log("Upper click"); @@ -23,7 +23,7 @@ Rectangle { propagateComposedEvents: true z: 0 enabled: !disableLower - onClicked: { + onClicked: function (mouse) { mouse.accepted = false; clicksDisabled += 1; //console.log("Lower click"); diff --git a/tests/auto/quick/qquickmousearea/data/qtbug49100.qml b/tests/auto/quick/qquickmousearea/data/qtbug49100.qml index 39b293c8fa..d3dfe64d94 100644 --- a/tests/auto/quick/qquickmousearea/data/qtbug49100.qml +++ b/tests/auto/quick/qquickmousearea/data/qtbug49100.qml @@ -8,7 +8,7 @@ ListView { delegate: Text { text: index + 1 height: 30 - width: parent.width + width: ListView.view.width MouseArea { anchors.fill: parent } diff --git a/tests/auto/quick/qquickmousearea/data/rejectEvent.qml b/tests/auto/quick/qquickmousearea/data/rejectEvent.qml index 48b68ee845..03a075300a 100644 --- a/tests/auto/quick/qquickmousearea/data/rejectEvent.qml +++ b/tests/auto/quick/qquickmousearea/data/rejectEvent.qml @@ -23,7 +23,7 @@ Rectangle { id: mouseRegion2 objectName: "mouseRegion2" width: 120; height: 120 - onPressed: { root.mr2_pressed = true; mouse.accepted = false } + onPressed: function (mouse) { root.mr2_pressed = true; mouse.accepted = false } onReleased: { root.mr2_released = true } onCanceled: { root.mr2_canceled = true } } diff --git a/tests/auto/quick/qquickmousearea/data/updateMousePosOnResize.qml b/tests/auto/quick/qquickmousearea/data/updateMousePosOnResize.qml index 55af864060..a20f752864 100644 --- a/tests/auto/quick/qquickmousearea/data/updateMousePosOnResize.qml +++ b/tests/auto/quick/qquickmousearea/data/updateMousePosOnResize.qml @@ -22,19 +22,19 @@ Rectangle { property bool mouseMatchesPos: true anchors.fill: brother - onPressed: { + onPressed: function (mouse) { if (mouse.x != mouseX || mouse.y != mouseY) mouseMatchesPos = false x1 = mouseX; y1 = mouseY anchors.fill = parent } onPositionChanged: { emitPositionChanged = true } - onMouseXChanged: { + onMouseXChanged: function (mouse) { if (mouse.x != mouseX || mouse.y != mouseY) mouseMatchesPos = false x2 = mouseX; y2 = mouseY } - onMouseYChanged: { + onMouseYChanged: function (mouse) { if (mouse.x != mouseX || mouse.y != mouseY) mouseMatchesPos = false x2 = mouseX; y2 = mouseY diff --git a/tests/auto/quick/qquickmousearea/data/wheel.qml b/tests/auto/quick/qquickmousearea/data/wheel.qml index 3e0c0c2a48..6cd367b22f 100644 --- a/tests/auto/quick/qquickmousearea/data/wheel.qml +++ b/tests/auto/quick/qquickmousearea/data/wheel.qml @@ -14,7 +14,7 @@ Rectangle { MouseArea { anchors.fill: parent - onWheel: { + onWheel: function (wheel) { root.angleDeltaY = wheel.angleDelta.y; root.mouseX = wheel.x; root.mouseY = wheel.y; |