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

QTreeView doesn't show alternating row color in high contrast windows theme

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.4.0, 5.4.1
    • GUI: Look'n'Feel
    • None
    • Windows 8.1 x64

    Description

      QTreeView doesn't show alternating row color in high contrast windows theme. But it works fine in standard windows theme.

      Code to reproduce this bug:

      #include <QApplication>
      #include <QTreeView>
      #include <QStandardItemModel>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QStandardItemModel model;
          for (int row = 0; row < 10; row++)
              for (int col = 0; col < 10; col++)
              {
                  QStandardItem* item = new QStandardItem(QString("r%0,c%1").arg(row).arg(col));
                  model.setItem(row, col, item);
              }
      
          QTreeView view;
          view.setModel(&model);
          view.setAlternatingRowColors(true);
          view.show();
      
          return a.exec();
      }
      

      You can:
      1) Start the program when high contrast theme already applied
      2) Start the program when standard theme applied then change theme to high contrast

      Attachments

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

        Activity

          People

            bachewii Jens
            yuri_q Yuri M
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes