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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P1: Critical 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)

      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.

        1. test.qml
          1.0 kB
        2. screenshot.png
          screenshot.png
          20 kB
        3. privs error.jpeg
          privs error.jpeg
          70 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

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

              Created:
              Updated:
              Resolved: