Solved How to get line with that style?
-
Hi,
I would like to create line, which has style like this:
So 2 colors: white and gray and special effect ( left side is more transparent than right side ).
-
You could also use a widget with a stylesheet. Assuming the widget is 20px high something like this:
widget->setStyleSheet( "border-top: 10px solid qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgba(200, 200, 200, 0), stop:1 rgba(200, 200, 200, 255));" "border-bottom: 10px solid qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 255, 255, 0), stop:1 rgba(255, 255, 255, 255));" );
-
Hi
You might be able to get that effect using QGradiant and QPainter but
you could also just use a PNG with it predrawn and paint that.Do you need it in many sizes ?
-
You could also use a widget with a stylesheet. Assuming the widget is 20px high something like this:
widget->setStyleSheet( "border-top: 10px solid qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgba(200, 200, 200, 0), stop:1 rgba(200, 200, 200, 255));" "border-bottom: 10px solid qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 255, 255, 0), stop:1 rgba(255, 255, 255, 255));" );