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

Material.System (or Universal.System) isn't working

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 5.8.0 RC
    • Quick: Controls 2
    • None
    • Windows 10 x64

    Description

      When trying to set default system theme in the example Gallery from Qt QuickControls 2, the following code doesn't work:

      [Material]
      Primary=#41cd52
      Accent=#41cd52
      Theme=System
      
      [Universal]
      Accent=#41cd52
      Theme=System
      

      or if you want to debug the value, like this snippet (from my App):

      RadioButton {
          text: qsTr("Light")
          checked: appSettings.theme === "Light"
          ButtonGroup.group: modeBG
          onClicked: {
              appSettings.theme = "Light"
          }
      }
      RadioButton {
          text: qsTr("Dark")
          checked: appSettings.theme === "Dark"
          ButtonGroup.group: modeBG
          onClicked: {
              appSettings.theme = "Dark"
          }
      }
      RadioButton {
          text: qsTr("System theme")
          ButtonGroup.group: modeBG
          onClicked: {
              if (appSettings.style === "Material") {
                  appSettings.theme = "Material.System"
              } else {
                  appSettings.theme = "Universal.System"
              }
              console.log(Material.theme)
          }
      }
      

      it always returns qml: 0, never qml: 1

      Am I missing something?

      Attachments

        Issue Links

          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
              matthieu Matthieu Bachelier
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes