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

The QTreeWidget is painting poorly when the frame style is set to QFrame::Plain | QFrame::Box when using Windows 11 style.

    XMLWordPrintable

Details

    • Windows
    • 44edab7c8 (dev), 37effa5dd (6.9), 94fe6f04f (6.8), c917d16f4 (dev), 1ac5e9807 (6.9)

    Description

      The QTreeWidget is rendering poorly when the frame style is set to QFrame::Plain | QFrame::Box while using the Windows 11 style.
      To reproduce the issue, run the attached project and click on "QTreeWidget Bugs" button.
      A detailed description is in the dialog itself.

      Here also some reproducer for QTableView showing grid lines before:

      int main(int argc, char* argv[])
      {
          QApplication app(argc, argv);
          QTableWidget tw;
          tw.setColumnCount(5);
          tw.setRowCount(5);
          tw.setItem(0, 0, new QTableWidgetItem(app.style()->name()));
          tw.show();
          tw.setShowGrid(false);
          return app.exec();
      }
      

      Result after the current patches:

      Attachments

        1. after.png
          after.png
          13 kB
        2. before.png
          before.png
          16 kB
        3. image-2025-02-20-16-47-58-818.png
          image-2025-02-20-16-47-58-818.png
          5 kB
        4. QTreeWidgetBugs_Dark_6.8.1_with_annotations.png
          QTreeWidgetBugs_Dark_6.8.1_with_annotations.png
          48 kB
        5. QTreeWidgetBugs_Dark_6.8.1.png
          QTreeWidgetBugs_Dark_6.8.1.png
          40 kB
        6. QTreeWidgetBugs_Light_6.8.1.png
          QTreeWidgetBugs_Light_6.8.1.png
          34 kB
        7. Windows11StyleIssues.zip
          80 kB

        Issue Links

          For Gerrit Dashboard: QTBUG-131585
          # Subject Branch Project Status CR V

          Activity

            People

              wladimir.leuschner Wladimir Leuschner
              mahdi.belila Mehdi Belila
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: