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

Custom ScrollBar style not used after upgrade from 5.15 to 6.2

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 6.2.1, 6.2.2
    • Quick: Controls 2
    • None

    Description

      This is a regression introduced when upgrading from Qt 5.15.2 to 6.2.2.

      I have my own style for QtQuickControls as described in the docs. I do not need to override all components, so I have a fallback in my qmldir file:

      module QtQuick.Controls.MyStyle
      
      Button 6.0 Button.qml
      # ...
      ScrollBar 6.0 ScrollBar.qml
      
      # Fallback
      import QtQuick.Controls.Basic auto

      When I use a ScrollView (which I do not override from the Basic style), it does not use my custom-styled ScrollBar but the ScrollBar from the Basic style.

      I would expect it to use my custom-styled ScrollBar. This was also the behavior of Qt 5.15.2.

      Suggestion for a fix

      These are the imports in qtdeclarative/src/quickcontrols2/basic/ScrollView.qml:

      import QtQuick
      import QtQuick.Controls.impl
      import QtQuick.Templates as T
      

      It currently imports the ScrollBar from QtQuick.Controls.impl, so it does not get styled.

      If the imports were to be changed to the following, it would pick up the custom ScrollBar style:

      import QtQuick
      import QtQuick.Controls
      import QtQuick.Templates as T
      

      Workaround

      In the meantime, this can be solved by adding a ScrollView to the custom theme.

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            nikwen Niklas Wenzel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: