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

Theme properties set on Item are not propagated to children

XMLWordPrintable

    • c6b401a31 (dev), ce77d45d8 (6.5), 01de6b246 (6.6), e4ba076e4 (dev), 3d7f38140 (6.5), 0822bdf6a (6.6)

      Material.theme and Material.accent are not properly propagated to children if set on Item objects. This isn't the case if set on Window or ApplicationWindow.

      The following example shows, if Material.theme is set on the Rectangle rather than on the Window the ComboBox Popup isn't affected by the theme colors.

      https://stackoverflow.com/questions/76705911/qml-combobox-applying-material-them

      import QtQuick
      import QtQuick.Controls.Material
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          Rectangle {
              id: rectangle
              anchors.fill: parent
              color: "#2a2929"
              border.width: 4
      
              Material.theme: Material.Dark
              Material.accent: Material.Indigo
      
              ComboBox {
                  id: comboBox
                  x: 40
                  y: 425
                  model: 5
              }
          }
      }
      

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

            mitch_curtis Mitch Curtis
            henning Henning Gründl
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: