Edit: Forget this post. After retrying a couple of things I found the white color to be that QMainWindow's background style. Of course I had already tried that but I must have suffered a typo as it was not working before.
I keep the original post here in case someone else is interested in the margin's color and how to change it ...
Hi there
I hope its ok that I hijack this thread because it already contains all information I need to supply with my questions.
I'm trying to CSS my docking widgets but there seems to be one property I cannot get my hands on
My QDockWidget derived class uses a CSS margin to allow for some space between the docked widgets. Pretty much the same as the margin of the central widget in the image from the first post of this thread. So I have this white border around all of my docked widgets.
The border ist indeed what I want to have but how can I change the color of the margin.
As far as I understand the margin lets the background shine through. That's perfectly ok but who's background color is this damn white? Is there a way to change the QMainWindow backgriund color? Or is this the background color of the internal dock area (I'm using Qt 4.8 so there is no explicit QDockArea).
You can easily reproduce this by taking the sample shown above (official Qt sample "Main Window") and set a margin for the QDockWidget. Then try to change the color that shine through the margin.
Btw. the same applies for the toolbars I add to my QMainWindow. If they have a margin as well (which they should also have in my case) the also suffer from this ugly white background. If the overall style of the application is dark gray then this white does not look pretty fancy.
Or is there any other way to have an offset between my docked widgets? I also need the border feature as well so I cannot just fake the desired background color on the margins by abusing the background and padding styles.
Thanks for any input you can provide![]()
Bookmarks