PDA

View Full Version : Widget styles problem.



vinzz38
27th May 2013, 17:31
Hello all,

i have several style problems:

- Is there a way to change the font-weight (or font-size minimum) of the selected item in QListWidget?
I try this styleSheet:

"QListWidget::item:selected{font-size: 20px;"
"background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #cdcdcd, stop: 1 #5781AE);}"
The background color works, but not the font size.

- Is ther a way to change only the color of a QPorgressBar?
I mean that when i apply a style sheet only for the backround color like this

"QProgressBar::chunk {"
"background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 #76B900, stop: 0.5 white, stop: 1 #76B900 );}"
all properties of the original QProgessbar style are disabled.

Thanks for your answer.

Santosh Reddy
27th May 2013, 21:13
- Is there a way to change the font-weight (or font-size minimum) of the selected item in QListWidget?
No, as such font style option applies to QWidgets, so you could apply the font (or other like font-size) style option to the entire QWidget (QListWidget in this case) and not to special behavior of a derived QWidget i.e. QListWidget's selection item.


- Is ther a way to change only the color of a QPorgressBar?
I mean that when i apply a style sheet only for the backround color like this
No, Qt Style Sheets documentation (http://qt-project.org/doc/qt-4.8/stylesheet-examples.html#customizing-qprogressbar) clearly states this fact

The QProgressBar's border, chunk, and text-align can be customized using style sheets. However, if one property or sub-control is customized, all the other properties or sub-controls must be customized as well.

vinzz38
20th June 2013, 12:37
Thanks for your answers.