All4Gis/Load-QSS

qlineargradient in toolbar not working

Brigggi opened this issue · 2 comments

I want to have a qlineargradient for the QGIS toolbar.

But if I load a QSS file with the following code, the top toolbar is getting black while the bars below Browser and Layer get the desired gradient.

QToolBar {
    background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #0077B6 stop:1 #80CDEC);
}

QSS_test_colors

Is this a bug or am I doing something wrong?

Using a simple color, all bars work fine:

QToolBar {
    background-color: #80CDEC;
}

QSS_color_test2

funny, if you just change only the background color it doesn't work but if you add some change the border as well it works too. Why? I honestly don't know

QToolBar {
    border: 1px transparent #393838;
    background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #0077B6 stop:1 #80CDEC);
}

Thank you, that solved my problem! :)