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

Windows11Style: Item view selection hardly legible

    XMLWordPrintable

Details

    • Windows
    • c3d2a4972 (dev), 7cab94a4c (6.9)

    Description

      It is very hard to make out the selection on some displays. Especially with alternating row colors. (Items 42-47 are selected)

       

      Compare to the native look in File explorer.

      Code:

      QTreeWidget* MainWindow::createTreeWidget()
      {
          auto  treeWidget = new QTreeWidget;
          treeWidget->setHeaderLabel("Items");
          treeWidget->setAlternatingRowColors(true);
          treeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
          treeWidget->setSortingEnabled(true);
          for (int i = 1; i <= 100; ++i) {
              QTreeWidgetItem* item = new QTreeWidgetItem(treeWidget);
              item->setText(0, QString("Item %1").arg(i));
              item->setCheckState(0, Qt::Unchecked);
          }
          return treeWidget;
      } 

      Attachments

        1. alternate_rows_selection.png
          alternate_rows_selection.png
          20 kB
        2. Screenshot 2025-01-23 110657.png
          Screenshot 2025-01-23 110657.png
          26 kB
        3. image-2025-02-07-10-57-44-435.png
          image-2025-02-07-10-57-44-435.png
          32 kB
        4. image-2025-02-07-10-58-20-046.png
          image-2025-02-07-10-58-20-046.png
          31 kB
        5. image-2025-02-07-11-00-13-172.png
          image-2025-02-07-11-00-13-172.png
          8 kB
        6. image-2025-02-07-11-26-53-042.png
          image-2025-02-07-11-26-53-042.png
          8 kB
        7. alternate1.png
          alternate1.png
          62 kB
        8. alternate2.png
          alternate2.png
          62 kB
        9. nonalternate.png
          nonalternate.png
          50 kB
        10. ListView.png
          ListView.png
          49 kB

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              bjornpiltz Björn Piltz
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes