Originally Posted by
^NyAw^
Hi,
I have a QMainWindow that have a QToolBar. I want this toolbar to be painted with a gradient. Have I to create a derivate class and redefine the paintEvent or is there a easy way? I want to do the same with the central widget and some docks.
Thanks,
You can use style sheets for this with
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #E1E1E1, stop: 0.4 #FF92BB,
stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #E1E1E1, stop: 0.4 #FF92BB,
stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
To copy to clipboard, switch view to plain text mode
for instance.
Good luck
Bookmarks