Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set background color only partially with stylesheets

Tags:

qt

qt4

qt4.8

How can I set the background color for a part of the background like in the following image:

enter image description here

Of course, without border frames, I want to set only the cyan color.

I need to set the length of the left part (cyan) as the percentage of the widget length, e.g 30%.

like image 208
daisy Avatar asked Feb 21 '23 11:02

daisy


1 Answers

With css I would hack qlineargradient a little bit. Note that edge of cyan may be a little blurry.

QFrame
{
        background-color: qlineargradient(x1:0, x2: 1, stop: 0 cyan, stop: 0.29 cyan, stop: 0.2901 white, stop: 1 white);
}
like image 77
Kamil Klimek Avatar answered Feb 23 '23 00:02

Kamil Klimek