PinchArea zoom out

  • Hi;
    I'm working on that example:
    and wonder how to prevent pinch scale <1. I dont want to zoom- out I want to keep scale
    <1,4>. So I added

    PinchArea {
                    width: Math.max(flick.contentWidth, flick.width)
                    height: Math.max(flick.contentHeight, flick.height)
                    pinch.minimumScale : 1
                    pinch.maximumScale : 4

    But still can zoom-out <1.

  • I solve it shomehow.
    1085 - is my minaimal width(scale) of picture below which user cant zoom out

                    onPinchUpdated: {
                        isSaleAllowed = !(initialWidth * pinch.scale < 1085)
                        if( isSaleAllowed )
                            // adjust content pos due to drag
                            flick.contentX += pinch.previousCenter.x -
                            flick.contentY += pinch.previousCenter.y -
                            // resize content
                            flick.resizeContent(initialWidth * pinch.scale, initialHeight * pinch.scale,

    Documentation says:

    PinchArea can be used in two ways:
    setting a to provide automatic interaction with an item
    using the onPinchStarted, onPinchUpdated and onPinchFinished handlers


     pinch.minimumScale : 
     pinch.maximumScale :

    regards only to the first way.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.