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

Win11: Improve QTreeview style

XMLWordPrintable

    • Windows

      I have collected some issues with QTreeview rendering on Win11 with the modern look.

      The old look

      First, as a comparison the video win10.mp4shows what it used to look like on Windows 10.

      You can differentiate between

      • Selected items
      • The active item
      • The item under the mouse, regardless if it is selected or not

      and

      • The edit box aligns perfecly.

      The new look

      With the Windows 11 modern look (see win11-default.mp4), you can only differentiate between "selected and/or hovering" and "others". The highlight color is painted as a rounded rect in QWindows11Style::drawPrimitive and will be either a very discrete gray, or - for the alternating rows style - a very dark blue that clashes with the black text and bleeds into the checkboxes. (The blue highlight was a fix for this issue).

      There is also an issue with the edit box, as can be seen in the video.

      Stylesheets

      This has forced me to use style sheets in my applications to ensure usability.

      The result is an acceptable emulation of the Win10 look (win11-stylesheet.mp4) with some minor issues.

      The main problem is that the current rounded rect highlights are drawn in QWindows11Style::drawPrimitive and cannot be overridden by style sheets, this prohibits using transparency or rounded corners.

      Suggestion

      I think the highlight fix implemented here  https://codereview.qt-project.org/c/qt/qtbase/+/623376 should be reverted and replaced with something less visually jarring that integrates better with style sheets.

      You can even see in Qt Designer qt_designer_win11-Qt6.10-beta3.mp4that the dark blue rounded rects don't blend in well.

      See also

      https://bugreports.qt.io/browse/QTBUG-136130

      Code

      main.cpp

        1. main.cpp
          3 kB
        2. qt_designer_win11-Qt6.10-beta3.mp4
          1.75 MB
        3. win10.mp4
          2.33 MB
        4. win11-default.mp4
          2.96 MB
        5. win11-stylesheet.mp4
          3.81 MB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            wladimir.leuschner Wladimir Leuschner
            bjornpiltz Björn Piltz
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes