I'm trying to increase padding between widgets contained within a QMainWidget and the edges of the QMainWidget. You can see the problem in the image below:
There is no padding between QTabWidget (which is central widget of the QMainWidget) and the left edge of the main window. Also there is no padding between QDockWidgets and the right edge of the main window.
I tried to increase padding with QSS stylesheet:
QMainWindow {
padding: 10px;
margin: 10px;
border: 5px solid red;
}
but got some really unexpected result:
I tried calling setContentsMargins
method, but it actually changes the margins around the central widget just as the method's name says.
How can I increse padding between QMainWindow and contained widgets? Is there a way to change it with QSS?