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

QML Native ScrollBar: Unable to assign [undefined] to int

    XMLWordPrintable

Details

    • Windows
    • 901a8bf76 (dev), 17ecdb3f3 (6.5), 3267be5b0 (6.6), a6a8a094c (qds/dev)

    Description

      Working from QDS, there is a qml file in HelperWidgets named VerticallScrollBar.qml. It extends the QtQuickControls / Native ScrollBar.

      I get the following error on application output when I hover in the app over the scroll bar: 

      qrc:/qt-project.org/imports/QtQuick/Controls/Windows/ScrollBar.qml:69:49: Unable to assign [undefined] to int
      

      which appears to refer to the following line inside quickcontrols2/windows/ScrollBar.qml:

      visible: contentItem instanceof NativeStyle.StyleItem
      Behavior on opacity { NumberAnimation { duration: contentItem.transitionDuration } }     // <---------- this line
      

      The contentItem doesn't have the "transitionDuration" property, and that is because the contentItem is a Rectangle, rather than a NativeStyle.StyleItem. And that's because VerticalScrollBar.qml above  has the contentItem redefined like this:

      contentItem: Rectangle {
          implicitWidth: StudioTheme.Values.scrollBarThickness
          color: StudioTheme.Values.themeScrollBarHandle
      }
      

      This is something that the Qt Quick ScrollBar should have supported (given the  "contentItem instanceof NativeStyle.StyleItem" above), but somehow it seems that this animation is being called, and this NativeStyle.ScrollBar object ends up being visible, although the contentItem is redefined as a Rectangle.

       

      Example project attached.

      When hovering scrollbar with mouse, you get output
      "qrc:/qt-project.org/imports/QtQuick/Controls/Windows/ScrollBar.qml:69:49: Unable to assign [undefined] to int"

      Attachments

        Issue Links

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

          Activity

            People

              fabiankosmale Fabian Kosmale
              saghinet Samuel Ghinet
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes