PDA

View Full Version : How can i make a QProgreessBar with rounded edges and gradient color background?



Gerard
16th August 2011, 12:40
How can i make a QProgreessBar with rounded edges and gradient color background green-yellow-orange-red? ( I'm using QT4.3 embedded linux )

I'm trying with stylesheet. Gradient works perfectly, but rounded edges no.

the code is this:

bar.setStyleSheet( "QProgressBar::chunk:vertical { background: QLinearGradient(x1: 0.5, y1: 1, x2: 0.5, y2: 0, stop: 0 #4bfd05, stop: 0.35 #fdee05, stop: 0.75 #fd9d05, stop: 1 #fd051c); border: 1px transparent; border-radius: 8px; color: transparent}");


what's wrong??


Thanks

nix
16th August 2011, 15:16
It works for me with with adding :


QProgressBar {
border: 1px transparent;
border-radius: 8px;
color: transparent
}
to your styleSheet string.

Gerard
16th August 2011, 16:50
It works! Another problem was the parent widget size was less.

Thanks