PDA

View Full Version : How to make QtreeWidget's custom check, uncheck and Scrollbar



santosh.kumar
17th August 2010, 12:23
Hi

I m developing application that need custom QTreeWidget.
I have used setStyleSheet for QTreeWidget so that its look like Custom QTreeWidget.
But its Check, Uncheck and Scrollbar doen't make custom .It looks like Standard.
Kindly check attatchment. In the attatchment I have make three seperate custom QCheckBox. I m showing icon on check, uncheck of QCheckBox.
But for QTreeWidget, How we can use this custom QCheckBox or there is other way to show it.
for e.g.

QTreeWidgeItem *p = new QTreeWidgetItem(treeWidget);
p->setCheckState(0,Qt::Checked);

for e.g.
QString str = "QTreeView { alternate-background-color: red;}"
"QTreeView { show-decoration-selected: 1;}"
"QTreeView::item {border: 1px solid #d9d9d9;border-top-color: transparent; border-bottom-color: transparent;}"
"QTreeView::item:hover {background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e7effd, stop: 1 #cbdaf1);border: 1px solid #bfcde4;}"
"QTreeView::item:selected {border: 1px solid #567dbc;}"

((QTreeView*)treeWidget)->setStyleSheet(str);


But How we can make QTreeWidget's checkbox custom so that we can our icon
and also custom scrollbar for QTreeWidget so that our scroll's Image will show.

Thanks
Santosh