Closed prjemian closed 1 year ago
To set background color of a cell, see: https://stackoverflow.com/a/60768287
The table QAbstractTableModel emits a custom signal (unsuccessfulRun
) from its data()
method when the run's exit_status
is not successful
. Arguments needed are row, column, and exit_status. The table
object is useful.
The QTableView connects that signal to its own custom slot to change the cell's background color.
Perhaps a different strategy, see https://stackoverflow.com/a/44104745, in short, return a QBrush for BackgroundRole:
elif role == QtCore.Qt.BackgroundRole:
return QtGui.QBrush("blue")
On first public demonstration, a user asks if, in the QTableView, can the background color be changed for runs where the exit status is other than
"successful"
?