CodePudding user response:
Combined with the model is used, can,CodePudding user response:
See example: $${QT_DIR} \ examples, widgets, tutorials, modelviewCodePudding user response:
Check the Qt: : ItemDataRole types in Qt: : BackgroundRole in model setData (index, QBrush (QColor (" # 0 x00ff00 ")), Qt: : BackgroundRole);CodePudding user response:
3/f is the way you said a test?CodePudding user response:
This is my way the implementation of the http://www.cnblogs.com/justwake/archive/2013/06/02/3113634.htmlCodePudding user response:
QAbstractItemModel http://www.cnblogs.com/justwake/archive/2012/12/22/justwake_3.htmlCodePudding user response:
Set the cell color, it is set up on the Item of the Model, to get a case of Item (QStandardItem Item) QBrush brush=QColor (255, 0, 0). Item. SetBackground (brush);//set to red QBrush br=QColor (255, 255, 0). Item. SetForeground (br);//font for yellowCodePudding user response:
The