I am trying to increase the padding between widgets contained in a QMainWidget and the edges of a QMainWidget. You can see this problem in the image below:

There is no padding between the QTabWidget (which is the central QMainWidget widget) and the left edge of the main window. There is also no padding between QDockWidgets and the right edge of the main window.
I tried to increase padding using the QSS stylesheet:
QMainWindow { padding: 10px; margin: 10px; border: 5px solid red; }
but got some really unexpected result:

I tried calling the setContentsMargins method, but it actually changes the fields around the center widget, as the method name says.
How can I add an add-on between QMainWindow and the contained widgets? Is there a way to change it using QSS?
c ++ qt qt5 qmainwindow qss
ezpresso
source share