2

Can i stylize QTreeWidgetItem like QCheckbox?

For my checkboxes style is:

 QCheckBox {
     spacing: 15px;
 }

 QCheckBox::indicator {
     width: 20px;
     height: 20px;
 }

 QCheckBox::indicator:unchecked {
     image: url(:/styles/img/checkbox_unchecked.png);
 }

 QCheckBox::indicator:unchecked:hover {
     image: url(:/styles/img/checkbox_unchecked_hover.png);
 }

 QCheckBox::indicator:checked {
     image: url(:/styles/img/checkbox_checked.png);
 }

 QCheckBox::indicator:checked:hover {
     image: url(:/styles/img/checkbox_checked_hover.png);
 }

And what style would be for QTreeWidgetItem? I can't find it in documentation :(

Thanks!

Noisee
  • 306
  • 2
  • 7

1 Answers1

1

See: http://qt-project.org/doc/qt-4.8/stylesheet-reference.html#qtreeview-widget

Also, http://doc.qt.digia.com/4.7-snapshot/qtreewidgetitem.html There are quite a few "set" member functions for styling.

Maybe relevant:

HowTo draw QTreeWidgetItem with different style?

http://www.qtcentre.org/threads/26738-QTreeWidget-StyleSheet-problem

Community
  • 1
  • 1
Daniel Placek
  • 765
  • 5
  • 16
  • 2
    Thanks for reply! To stylize item in QTreeWidget: `QTreeWidget::indicator { width: 20px; height: 20px; } QTreeWidget:indicator:unchecked { background:red;}` etc.. – Noisee Oct 09 '12 at 07:00