Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradient for chunks in QProgressBar

Is it possible to set a common gradient for all QProgressBar chunks?

If use something like this:

QProgressBar::chunk:horizontal {
background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, 
                            stop: 0 green, 
                            stop: 1 white);
margin-right: 2px;    
width: 10px;
}

the result will be

http://labs.trolltech.com/blogs/wp-content/uploads/2007/06/progressbar_righttext.png

but I want to obtain a one gradient, stretched to all chunks. Like this:

http://labs.trolltech.com/blogs/wp-content/uploads/2007/06/progressbar_nochunk.png

divided onto chunks.

Thanks for all!

like image 465
ILYA Avatar asked May 30 '26 22:05

ILYA


1 Answers

You must only remove:

QProgressBar::chunk:horizontal {
    background: qlineargradient(x1: 0,
                                y1: 0.5,
                                x2: 1,
                                y2: 0.5,
                                stop: 0 green,
                                stop: 1 white);
    margin-right: 2px;
    width: 10px; // <------ remove this propierty
}
like image 148
Javier Avatar answered Jun 02 '26 19:06

Javier



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!