Hello!
I encountered an issue since last week.
I have a QStyleSheet which some default behavior for QTreeView (colors, borders...).
But in some cases, I would like to punctually change the color of the text, in order to highlight bad values for exemple, and I made this changes in ForegroundRole in data() method.
The problem that the ForegroundRole is completely ignored and it is the QSS attribute which is used.
Example:
color: black;
}
QTreeView {
color: black;
}
To copy to clipboard, switch view to plain text mode
{
...
case Qt::ForegroundRole:
}
QVariant data()
{
...
case Qt::ForegroundRole:
return QBrush(Qt::Orange);
}
To copy to clipboard, switch view to plain text mode
Orange is never applied and I would like to.
Thanks for your future answers!
Bookmarks