PDA

View Full Version : Cannot style the background of a QToolBar on Mac OSX



Urchulak
24th May 2012, 11:19
Hi all!

I have a problem styling the background of a QToolBar on Mac OSX. Im using Qt4.8.1 and Mac OS X 10.7
I set a global qss stylesheet for my application and everything works just fine. The only thing that does not have any effect is the background part of the QToolBar. I can still set the padding or height or anything but the background...
Here's the part of my stylesheet responsible for the toolbar:

QWidget#toolBarMainView{
padding-top:0px;
min-height:42px;
background-image:url(:/images/recources/img/assets/toolbar/background_img.png);
background-repeat: repeat-xy;
}

By the way: Im also using the same stylesheet and code for the application in windows. And in windows this problem does not occur.
I have already googled for this problem and i found a bugreport for this issue (https://bugreports.qt-project.org/browse/QTBUG-12717).
Does anyone know if this bug has been resolved and the problem is in my code or if the bug is still in qt?

Thanks in advance for any hints or tips,
Urchulak

Urchulak
4th June 2012, 11:19
Okay....

I've made a workaround for this: First I create an empty widget for my toolbar. Then I create a subclass of QToolBar and make the toolbar I want. Afterwards I just add the toolbar to the layout of my empty widget and I can style the background of that toolbar.

The issue seems to occur when a toolbar is added to a QMainWindow... On any other widget the toolbar is fully stylable.

Does anyone know if Qt has reloved this issue or is at least working on it?

Greetings
Urchulak