-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.5.0
-
None
Using Flickable, PinchArea and MouseArea, we have implemented pinch to zoom-in and double tap zoom-out feature on an image. The zoom-out on double tap happens abruptly without any animation. Can you please provide an animation parameter true/false in resizeContent() method of Flickable QML type to zoom-out to original size of image with animation on double tap.
Flickable {
id:flick
anchors.fill: parent
contentWidth: 1000
contentHeight: 1000
property size initialSize: image.sourceSize
PinchArea{
width: Math.max(flick.contentWidth, flick.width)
height: Math.max(flick.contentHeight, flick.height)
pinch.target: image
property real initialZoomWidth
property real initialZoomHeight
onPinchStarted: {
initialZoomWidth = flick.contentWidth
initialZoomHeight = flick.contentHeight
}
onPinchUpdated: flick.resizeContent(initialZoomWidth * pinch.scale, initialZoomHeight * pinch.scale, pinch.center)
onPinchFinished:flick.returnToBounds()
MouseArea{
anchors.fill: parent
onDoubleClicked: flick.resizeContent(initialSize.width, initialSize.height, Qt.point(initialSize.width/2, initialSize.height/2))
}
}
Image{
id: image
width: flick.contentWidth
height: flick.contentHeight
source: "highrise.jpeg"
}
}