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

[REG] 908aa77d16e00f2bccc0ddae0f8b61955c56a6a1 breaks scrollbars if contentItem is accessed before it is set

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 6.4.0 RC1, 6.5.0 Beta1
    • 5.15.5, 6.4.0 Beta2, Some future release
    • Quick: Controls 2
    • None
    • 58bae53237 (qt/qtdeclarative/dev) 58bae53237 (qt/tqtc-qtdeclarative/dev) 0e511dd67a (qt/qtdeclarative/6.3) d429f31730 (qt/qtdeclarative/6.4) 0e511dd67a (qt/tqtc-qtdeclarative/6.3) d429f31730 (qt/tqtc-qtdeclarative/6.4)

    Description

      If the contentItem of the ScrollView is not declared as a child of the ScrollView and some binding contains contentItem then no Scrollbars will be shown.

      This is because when the binding is evaluated and the contentItem is not set yet, QQuickScrollViewPrivate::ensureFlickable will create and set a flickable. When the actual contentItem is assigned QQuickScrollBarAttachedPrivate::cleanupVertical(Horizontal) will be called which hides the scrollbars and unsets its parent (in hideOldItem).
      As far as I could see this is not undone in initVertical or initHorizontal.
      This is problematic for us since our custom style contains a binding that references contentItem.

      Reverting 908aa77d16e00f2bccc0ddae0f8b61955c56a6a1 fixes it.

      I've attached a file to show the issue with the Basic style.

      Attachments

        1. privs error.jpeg
          privs error.jpeg
          70 kB
        2. screenshot.png
          screenshot.png
          20 kB
        3. test.qml
          1.0 kB

        Issue Links

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

          Activity

            People

              mitch_curtis Mitch Curtis
              davidre David Redondo
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: