I am trying to set the bacground color of a QToolBar in Qt designer with the following in stylesheet background : rgb(30, 30, 30)
. For some reason the background color is only applied to the action's background as can be seen in the image. How can I change the color of the whole toolbar?
Edit.
Even if I change the background color of my whole window, the area of toolbar is not affected:
This is an empty default Qt widgets application where I only added a QToolBar and one QAction and in the stylesheet of my QMainWindow
background : red;
QToolBar { background : red }
QToolButton {background : red}
Is this expected behaviour or a bug on qt with linux?
edit.
I tried this code on Xubuntu 14.04 with Qt 4.8 and Qt 5.4.2. This seems to be a bug on Qt. See my own answer below.