xEsk
11th November 2007, 17:12
Hi,
I'm painting a QProgressBar (using QStyleOptionProgressBar) into a QTreeView and works perfectly, ok, now I want customize this QProgressBar.
I made an a style sheet which works perfectly with a normal QProgressBar (not delegated), but I don't know how to set this Style Sheet to my delegated QProgressBar, because the QStyleOptionProgressBar don't have the styleSheet (http://doc.trolltech.com/4.3/qwidget.html#styleSheet-prop) property.
This is the style sheet used to customize the QProgressBar:
QProgressBar:horizontal {
border: 1px solid gray;
border-radius: 3px;
background: white;
padding: 1px;
}
QProgressBar::chunk:horizontal {
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #616161, stop: 0.5 #505050, stop: 0.6 #434343, stop:1 #656565);
color: white;
padding-left: 4px;
border: 1px solid #6c6c6c;
}
Best regards, xEsk.
I'm painting a QProgressBar (using QStyleOptionProgressBar) into a QTreeView and works perfectly, ok, now I want customize this QProgressBar.
I made an a style sheet which works perfectly with a normal QProgressBar (not delegated), but I don't know how to set this Style Sheet to my delegated QProgressBar, because the QStyleOptionProgressBar don't have the styleSheet (http://doc.trolltech.com/4.3/qwidget.html#styleSheet-prop) property.
This is the style sheet used to customize the QProgressBar:
QProgressBar:horizontal {
border: 1px solid gray;
border-radius: 3px;
background: white;
padding: 1px;
}
QProgressBar::chunk:horizontal {
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #616161, stop: 0.5 #505050, stop: 0.6 #434343, stop:1 #656565);
color: white;
padding-left: 4px;
border: 1px solid #6c6c6c;
}
Best regards, xEsk.