Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-114450

Flickable: Add animation parameter to resizeContent() method

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.5.0
    • None
    • Android, iOS/tvOS/watchOS, macOS

    Description

      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"
          }
      } 

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            sunilfyi Sunil Reddy
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes