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

QtQuick Fusion Style ignores custom palette in Qt 6.5.2

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.2
    • Quick: Controls 2
    • None
    • Windows

    Description

      Hi,

      In Qt 5.15 it was possible to set a custom palette that was used by the QtQuick Fusion style. That means, if I add the following lines to the Qt Quick Controls Gallery example:

      auto p = QGuiApplication::palette();
      p.setColor(QPalette::Highlight, Qt::red);
      p.setColor(QPalette::HighlightedText, Qt::red);
      QGuiApplication::setPalette(p);

      and run it with Qt 5.15, then I can see the following:

       

      If I do the same for Qt 6.5.2, then then I can see the following - the system highlight color is used and the application palette is ignored.

      I thinks this might be related to the changes documented here:

      https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5

      We have an application that uses a dark style no matter what style is set in Windows. We use a mixture of QWidget and QtQuick controls and if the user uses light mode in windows, then the fusion style in our application is rendered with wrong colors because it ignores the dark application palette. It worked fine in Qt5.15.

      So is there any way in Qt 6.5. to make the QtQuick fusion style respect the application palette?

      Attachments

        1. FusionStyle_5.15.2.png
          14 kB
          Uwe Kindler
        2. FusionStyle_6.5.2.png
          14 kB
          Uwe Kindler
        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
            ukindler Uwe Kindler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes