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

Styles with basic QPlatformTheme have stuck with Fusion palette

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15, 6.5, 6.8, 6.9
    • QPA, Widgets: Styles
    • None
    • Linux/Wayland, Linux/X11

    Description

      When using QT_STYLE_OVERRIDE to change the style on a DE-less Linux system, the style always uses Fusion palette. This is visible even with the builtin windows style (QT_STYLE_OVERRIDE=windows).

      A way to solve this I found so far is

      diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp
      index a11388fdb6f..0d050e8c486 100644
      --- a/src/gui/kernel/qplatformtheme.cpp
      +++ b/src/gui/kernel/qplatformtheme.cpp
      @@ -368,6 +368,7 @@ void QPlatformThemePrivate::initializeSystemPalette()
       {
           Q_ASSERT(!systemPalette);
           systemPalette = new QPalette(qt_fusionPalette());
      +    systemPalette->setResolveMask(0);
       }
       
       QPlatformTheme::QPlatformTheme()
      

      which would make the style palette being preferred in https://github.com/qt/qtbase/blob/a72077a88903fe532f6a749677eb4da4ea99f79f/src/widgets/kernel/qapplication.cpp#L1105

      Attachments

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

        Activity

          People

            vestbo Tor Arne Vestbø
            ilya-fedin Ilya Fedin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes