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

Setting same color in qtquickcontrols2.conf and QPalette for the application unsets that color

    XMLWordPrintable

Details

    • Linux/X11, Windows

    Description

      When setting a color (for example ButtonText) for a palette in qtquickcontrols2.conf and the same color in QPalette which is set for the QGuiApplication, that color is not used. Instead default color is used for that component.

      If QPalette and the value in qtquickcontrols2.conf are different, then qtquickcontrols2.conf value will be used.

          QPalette palette;
          palette.setBrush( QPalette::ButtonText, QColor( 255, 0, 0 ) );
          QGuiApplication app(argc, argv);
          QGuiApplication::setPalette( palette );
      
      [Controls]
      Style=Imagine
      
      [Imagine]
      Path=:/imagine-assets
      
      [Imagine\Palette]
      ButtonText=#ff0000
      

      This causes the button text color to be default value.

      Attached sample reproduces the issue, modifying the qtquickcontrols2.conf to have different color for ButtonText fixes the issue.

      Attachments

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

        Activity

          People

            kagro Kaj Grönholm
            jussi_witick Jussi Witick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes