Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Fusion Style ignores custom palette in Qt 6.5.2
Forum Updated to NodeBB v4.3 + New Features

Fusion Style ignores custom palette in Qt 6.5.2

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 450 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Uwe Kindler
    wrote on last edited by Uwe Kindler
    #1

    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:

    quick_controls_gallery_Qt515.png

    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.

    quick_controls_gallery_Qt652.png

    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?

    Thank you very much for any help.

    1 Reply Last reply
    1

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved