I do this in the constructor of a QMainWindow superclass:
layout()->setContentsMargins(0, 0, 0, 0);
centralWidget()->layout()->setContentsMargins(0, 0, 0, 0);
layout()->setContentsMargins(0, 0, 0, 0);
centralWidget()->layout()->setContentsMargins(0, 0, 0, 0);
To copy to clipboard, switch view to plain text mode
but still some margins remain (about 2 pixels) between the central widget and the main window. How do I remove the margins completely? I am trying to do this as I use QMainWindow as a child of QStackedWidget and don't need the margins.
Added after 20 minutes:
It was a QFrame frameShape of a subcontrol that made it appear, as if margins still existed. Thanks!
Bookmarks