PDA

View Full Version : Change HLine color



smtgra011
4th July 2007, 14:17
Hi, I'm trying to display a hierarchy and am using HLines and VLines to show relationship.

The only problem is that I can't seem to change their color.

Any help would be much appreciated.

Cheers
G

wysota
4th July 2007, 16:50
What kind of hierarchy? Maybe it'll be easier if you just paint all lines and text instead of using line widgets?

jpn
4th July 2007, 19:01
A QFrame with frame shape of QFrame::VLine or QFrame::HLine and frame shadow of QFrame::Plain draws the line with QPalette::WindowText:


QPalette palette = line->palette();
palette.setColor(QPalette::WindowText, Qt::red);
line->setPalette(p);

smtgra011
5th July 2007, 07:55
Legendary, thanks alot.

Cheers
G