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

BoundaryRule fails to enforce limits when property is set indirectly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.4.0 Beta2
    • None

    Description

      This can be demonstrated with qtwebengine/tests/manual/quick/pdf/pdfPageView.qml: if you zoom in or out a long way (using e.g. control-mousewheel), the page may remain scrolled out of the viewport, despite this call to returnToBounds():

          PdfPageView {
              id: pageView
      ...
              onRenderScaleChanged: pageView.returnToBounds()
      ...
              BoundaryRule on y {
                  id: bry
                  objectName: "bry"
                  minimumOvershoot: 100
                  maximumOvershoot: 100
                  minimum: Math.min(0, root.height - pageView.height)
                  maximum: 0
              }
      
              function returnToBounds() {
                  bry.returnToBounds()
                  brx.returnToBounds()
              }
          }
      
      

      The reason is that QQuickBoundaryRule::returnToBounds() checks currentOvershoot() which simply returns d->currentOvershoot; but zooming only changed the Image's width and height, and therefore indirectly changed the size of the PdfPageView: the QML code did not directly set y as a result of zooming, so BoundaryRule did not intercept it, and therefore doesn't know that there is any overshoot. Both currentOvershoot and targetValue are outdated at that point.

      Perhaps when the user calls returnToBounds(), we should assume there is a good reason, and be more thorough about checking. The way to fix it seems to be

          d->targetValue = d->easedOvershoot(d->property.read().toReal());
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-105106
          # Subject Branch Project Status CR V

          Activity

            People

              srutledg Shawn Rutledge
              srutledg Shawn Rutledge
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: