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

QTreeWidgetItem::setForeground does not have any impact if stylesheet for QTreeWidget::item at application level

    XMLWordPrintable

Details

    • macOS, Windows

    Description

      If a user is setting color for QTreeWidgetItem using QTreeWidgetItem::setForeground() for some column and user have a stylesheet where different color is specified for QTreeWidget:: item, it is expected that foreground color should take priority but stylesheet is overriding the color settings.

      Please find a sample attached and you can see that

      setStyleSheet("QTreeWidget::item {color: red;border: 1px solid black;}");
      item->setForeground(COLUMN_NAME, QBrush(QColor(Qt::blue)));
      

      But the end result is everything is in red color

      Attachments

        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
              shmittal Shveta Mittal
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes