0
votes

I'm trying to create a QTabWidget contained within a QDockWidget with no padding so the tab widget reaches the edges of the QDockWidget.

You can see in the image below the problem. The QTabWidget on the right inside the layout clearly has no padding but the QTabWidget on the left inside the QDockWidget does.

Qt Designer

This padding is there using all the default styles, cleanlooks, plastique and the OSX style.

I have tried adding the following qss to the QTabWidget, QDockWidget, QWidget, QMainWindow but the padding between the dock widget and the tab widget always remains!

padding: 0;
margin: 0;

Does anybody know what I need to do to remove this space.

1

1 Answers

0
votes

I discovered that the cause of this is the main layout of the QtabWidget. There is no way to alter the padding in qss but you can alter it directly in QtDesigner or in the code. To do so edit the contents layout of the tab widget and change all layout margins to 0.

This can be done in QtDesigner here:

enter image description here