Use Qt's BackgroundRole to color entire rows based on your data (opens in new tab)
I have a QTableView table showing some data about connected devices. How can I highlight rows to give a visual indicator of the current status of the device? When you're working with a QTableView and a custom model, it's common to want to highlight entire rows based on some condition in your data. For example, you might want to color a row blue when a device has a connected status, or red when something has gone wrong. Understanding How data() Works In Qt's , the view calls your model's data(...
Read the original article