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

[REG 6.3.0->6.3.2]Fusion: QComboBox, QHeaderView backgrounds don't apply new QPalette

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 6.3.2, 6.4.0
    • Widgets: Styles
    • None
    • I can only test it on ARM platform (Apple M1 Pro) and Linux/Windows VMs on ARM. But ARM Windows is using the x86 Qt packages...
    • Linux/Wayland, Linux/X11, macOS, Windows
    • 436159

    Description

      Hello Qt team,

       

      First, thank you for this solid framework.

      I use QPalette to switch between a light mode and a dark mode in my QWidget application.

      Using the Fusion style, the switch isn't applied to the background of QComboBox and all the headers of the QAbstractItemView family.

      You can see attached a simple example, with the source code.

       

      Dark palette:

       

       

      After resizing the window and the size of the first column header, these problematic widgets are painted properly.

      When the resize is little, resizing back to the original size brings back the wrong color. Bigger resize is needed to "overwrite" the cached paint.

       

      For the QComboBox, I found a way to temporarily fix the painting : resizing programmatically :

       In CustomComboBox: 
      
      for(int i = 40; i < 500 ; i++){ 
          this->setFixedWidth(i); 
          this->repaint(); 
      } 
      this->setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); 
      this->update();

      For QHeaderView, it becomes more of a hassle, so here I am reporting this bug.

       

      Thanks !

       

      Attachments

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

        Activity

          People

            tpochep Timur Pocheptsov
            skrib Cyril Jacquet
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes