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

Style import triggers style change

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.9
    • Quick: Controls 2
    • None

    Description

      According to documentation

      import QtQuick.Controls 

      enables run-time style selection (https://doc.qt.io/qt-6/qtquickcontrols-styles.html#run-time-style-selection)

      However importing style later, e.g. QtQuick.Controls.Universal causes style change anyways. Moreover when imported in another file, leads to mixture of two styles.

      When there is style import, also QQuickStyle::setStyle call and QT_QUICK_CONTROLS_STYLE are ignored. The last import takes precedence.

       

      Another issue is that for compile-time style selection the necessity of using file selectors to adjust specific types is not well documented. It's somehow presented in Gallery Controls example but even there it looks like not handy workaround rather then systematic solution.

      In comparison to Qt5 handling multiple styles seem to be quite problematic and lack of explicit documentation leads to various unexpected behaviors.

       

      Attachments

        1. Screenshot_2025-05-09_at_17.33.36.png
          288 kB
          Michał Cieślak
        2. QtPlayground.zip
          4 kB
          Michał Cieślak
        3. Screenshot 2025-05-12 at 10.06.53.png
          77 kB
          Michał Cieślak
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            michalc Michał Cieślak
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes