UN-GCPDS / qt-material

Material inspired stylesheet for PySide2, PySide6, PyQt5 and PyQt6
https://qt-material.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
2.39k stars 253 forks source link

Cannot set background/foreground color of QStandardItem in QListView #118

Open Tropaion opened 2 months ago

Tropaion commented 2 months ago

I have a QListView, where I try to change the color of some of the items, but sadly it doens't work the provided stylesheets.

item = self._list_data_model.item(index)

# Change color of item
item.setForeground(color)
item.setBackground(colo1)

How can I make it work?