QVariant headerData (int section, Qt: : "Orientation" Orientation, int role) const
{
If (role==Qt: : DisplayRole & amp; & Orientation==Qt: : Horizontal)
{
If (section & lt; HeaderData. The size ()
Return HeaderData. At (section);
The else
Return QVariant ();
}
If (role==Qt: : BackgroundRole)
Return QBrush (QColor (Qt: : green));
If (role==Qt: : ForegroundRole)
Return QBrush (QColor (Qt: : red));
Return QVariant ();
}
CodePudding user response:
Is there a written proxy or CSS stylesheetCodePudding user response:
Didn't write the agent, also did not use style sheetsCodePudding user response:
Today also in use qtableview seems only to form the "content", inside background or border are not, use the style sheet or agent (to headerview setting agent)