Adknocker
5th February 2019, 12:56
I have a QTreeView which has a stylesheet applied to items with "QTreeView::item{background-color:#F7F7F7}". The view has a custom model and in the data method, I change the background of some specific cells like this :
if (index.column() == 3 && role == Qt::BackgroundColorRole)
{
return QColor("#F4FF81");
}
But this is not working to overwrite the value set in stylesheet. Is there anyone who can tell me what I miss? Thanks!!!
if (index.column() == 3 && role == Qt::BackgroundColorRole)
{
return QColor("#F4FF81");
}
But this is not working to overwrite the value set in stylesheet. Is there anyone who can tell me what I miss? Thanks!!!