Erik_Klein
23rd September 2009, 12:16
In Short,
Anyone has any clue on how to set background color specific per header in a table???
Guys, would really appreciate some help with this - looked everywhere and nothing working yet.
What im trying to do is to have a tablewidget with 2 distinctive horizontal header styles, so some columns headers will have a colour background whilst another columns will have a different color header background.
The thing is, the basic properties settings(right-click menu) in QT Designer for setting color background looks really buggy and simply does not work, so im trying to do this through stylesheet.
What i've done is....
QHeaderView::section
{
spacing: 10px;
background-color:lightblue;
color: white;
border: 1px solid red;
margin: 1px;
text-align: right;
font-family: arial;
font-size:12px;
}
but this applies to all the headers.
then, if i want multiple background colors, there is only one way to do it which is...
using QHeaderView::section:last or QHeaderView::section:first ,
which would be perfect IF i only had 3 headers to style, but i am working with many different tables containing 6+ columns!
Anyone has any clue on how to set background color specific per header in a table?? Appreciate any help!!
thanks,
Erik
Anyone has any clue on how to set background color specific per header in a table???
Guys, would really appreciate some help with this - looked everywhere and nothing working yet.
What im trying to do is to have a tablewidget with 2 distinctive horizontal header styles, so some columns headers will have a colour background whilst another columns will have a different color header background.
The thing is, the basic properties settings(right-click menu) in QT Designer for setting color background looks really buggy and simply does not work, so im trying to do this through stylesheet.
What i've done is....
QHeaderView::section
{
spacing: 10px;
background-color:lightblue;
color: white;
border: 1px solid red;
margin: 1px;
text-align: right;
font-family: arial;
font-size:12px;
}
but this applies to all the headers.
then, if i want multiple background colors, there is only one way to do it which is...
using QHeaderView::section:last or QHeaderView::section:first ,
which would be perfect IF i only had 3 headers to style, but i am working with many different tables containing 6+ columns!
Anyone has any clue on how to set background color specific per header in a table?? Appreciate any help!!
thanks,
Erik