PDA

View Full Version : Problem in QT treewidget background colour



keyurparekh
8th February 2011, 13:10
Dear all,

I am facing problem in changing background color of tree widget.

I have add some items in tree widget.
but when try to change back ground colour than it only changes colour of some part of widget.
item part remain white only.
it not changes to actual back ground of tree widget.
please help me in this matter.
i m not able to complete this task.

aamer4yu
8th February 2011, 13:36
What did you try ?
Without knowing wat code you wrote, its not possible to guess where you are going wrong.

d_stranz
8th February 2011, 23:46
Question was asked by the same poster in QtForum.org, and was answered 5 days ago without acknowledgment or thanks. So either he never bothered to check to see if his question was answered, or didn't like the answer given. Answer as posted there was to try one of the following:



QTreeWidgetItem::setBackground();

// and / or

QPalette p = treeWidget->palette();
p.setBrush( QPalette::Base, QBrush( Qt::blue );
treeWidget->setPalette( p );