how to set the color of row numer that is diffrent with table header?
-
@Harning
Hello and welcome.Your question is unclear: what does "diffrent with table header" mean?
If you have a model, and you are using, say, a
QTableViewto display it, one way is to use QVariant QAbstractItemModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const where forrole == Qt::ForegroundRoleor perhapsQt::BackgroundRoleyou make it return the desired color. If the color varies by row number you can look at the passed inindex.row()to determine which color to return.