Search code examples
qtqt-designer

Getting rid of QtTabWidget margins


I'm trying to make an application that uses a tab widget as its top-most layout element besides the MainWindow and the central widget (as created by default by Qt Designer). For that purpose, I don't need any margins on my QtTabWidget.

Unfortunately, I can't seem to fully get rid of them. I basically want the QtTabWidget to take all the space available except for the menubar and the status bar.

I came darn close to having it sorted out, but the right margin refuses to subsede even after I've set it to 0 (central widget's layoutRightMargin is set to 0). Here's an image of the issue: Notice that right margin?

If you zoom in, you'll notice the right margin between the tab and the application frame border. SO squishes the image a bit so you might have to zoom it to see it, but trust me it's really visible (and annoying) at full resolution.


Solution

  • Sounds like you might want documentMode:

    screenshot