Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.13.0, 5.15.0
-
None
-
Qt 5.13 - Qt 5.15 on Windows, Android and Linux X11
-
-
5171bcd9c (dev), f00edf756 (6.5), 9b00d83b1 (tqtc/lts-6.2)
Description
In the example below (taken from the official [Qt Example](https://doc.qt.io/qt-5.12/qtquick-touchinteraction-pincharea-flickresize-qml.html):
main.qml
import QtQuick 2.13 import QtQuick.Controls 2.13 ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("Flickable Image Zoom Example") Flickable { id: flick anchors.fill: parent contentWidth: 500 contentHeight: 500 PinchArea { id: pinchArea width: Math.max(flick.contentWidth, flick.width) height: Math.max(flick.contentHeight, flick.height) property real initialWidth property real initialHeight onPinchStarted: { initialWidth = flick.contentWidth initialHeight = flick.contentHeight } onPinchUpdated: { // adjust content pos due to drag flick.contentX += pinch.previousCenter.x - pinch.center.x flick.contentY += pinch.previousCenter.y - pinch.center.y // resize content flick.resizeContent(initialWidth * pinch.scale, initialHeight * pinch.scale, pinch.center) } onPinchFinished: { // Move its content within bounds. flick.returnToBounds() } Rectangle { width: flick.contentWidth height: flick.contentHeight color: "white" Image { function fitToScreen() { var s = Math.min(flick.width / width, flick.height / height, 1) pinchArea.pinch.minimumScale = s } anchors.fill: parent fillMode: Image.PreserveAspectFit source: "qrc:/messi.jpg" onStatusChanged: { if(status == Image.Ready) fitToScreen() } MouseArea { id: mouseArea anchors.fill: parent } } } } } Button{ text: mouseArea.enabled ? "MouseArea Enabled" : "MouseArea Disabled" onClicked: mouseArea.enabled = !mouseArea.enabled } }
The user is unable to zoom using pinch gestures about 90% because the `Flickable` steals all the events from `PinchArea`. In order to make the `PinchArea` work 100% it is necessary to insert a `MouseArea` inside the `PinchArea`. In my code, I have inserted a button which toggles a `MouseArea` inside the `PinchArea` and testing I can confirm that the `PinchArea` only works correctly when the `MouseArea` is enabled. Another example of this bug can be found on my [Stackverflow post](https://stackoverflow.com/questions/57503125/qml-pincharea-not-working-as-expected-with-qml-flickable).
I have also attached a video of the issue.
Attachments
Issue Links
- is duplicated by
-
QTBUG-85278 PinchArea inside Flickable not working properly
- Closed
- relates to
-
QTBUG-73034 MultiPointTouchArea stalls underlying Flickable after grabbing once
- Reported
-
QTBUG-106223 assertion failed after Flickable takes grab from PinchHandler
- Closed
- resulted in
-
QTBUG-110903 Flickable reacts to multi-touch parallel movements on QNX
- Closed