PDA

View Full Version : qss qtreeview and checkboxes



fsmoke
9th November 2014, 16:10
How to stylize checkboxes in treeview?
10740

StrikeByte
10th November 2014, 16:18
I presume they are just normal checkboxes?
Just create a stylesheet for checkboxes and apply it to the treeview
QCheckBox::indicator:unchecked
{
color:rgb(255,0,0);
}
QCheckBox::indicator:checked
{
color:rgb(0,0,255);
}

or if you want to make one global stylesheet and not affect any other checkboxes use the child selector (all the checkboxes need to be a direct child of the QTreeView else use a space instead of > )

QTreeView > QCheckBox::indicator:unchecked
{}

QTreeView > QCheckBox::indicator:checked
{}

fsmoke
10th November 2014, 17:13
It is not work!! QCheckBox already styled.

And i try your solution


QTreeView > QCheckBox::indicator:unchecked
{}

QTreeView > QCheckBox::indicator:checked
{}
But still nothing

I aready find solution

http://qt-project.org/forums/viewthread/49497/