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

Button does not obey its button palette field

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.3.1
    • Quick: Controls 2
    • None
    • Win10/QTCreator 8.0/MinGW11
    • Windows

    Description

      When configuring a palette for a button (standard one, no styling beside the palette), the buttonText controls text color, but all other palette fields mentioned in button.qml are not functional.

      Here is a nonsensical example to display the problem:

          Button {
              id: control // named like this just for later test below.
              text: qsTr("I am ready!")
              palette {
                  button: "red"
                  buttonText: "red"
                  dark: "red"
                  mid: "red"
                  highlight: "red"
              }
          }
      

      Here is the visual result on Windows (file is attached as test.qml, can be opened with qml.exe):

      Looking at Button.qml, I don't see what is causing the bug. palette.buttonText works, palette.button does not. They are structurally at the same depth, seemingly referencing the same control thing.
      Strangely, if we copy-paste the background part of Button.QML (hopefully, I got the right file; there as so many with this name. I chose the one in "Basic" folder) in the button itself below palette, it works as we would expect. (file is attached as test2.qml can be opened with qml.exe)

      Attachments

        1. image-2022-08-01-22-51-07-858.png
          image-2022-08-01-22-51-07-858.png
          1 kB
        2. test.qml
          0.4 kB
        3. test2.qml
          0.9 kB

        Issue Links

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              eden2004 Jerome Banal
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: