Skip to content Skip to sidebar Skip to footer

Qt Stylesheets - How To Remove Dead Space

I am creating a simple plotting application using PySide and have a problem with loads of dead space. How can I remove all this extra padding using stylesheets (preferably) or prog

Solution 1:

If you color the background of your widgets you see that no value for property margin or padding will change the spacing in between and the margin. This is controlled by the layout. Therefore in your layout set:

layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(0)

and all empty spaces should be gone. Unfortunately this can only be done programmatically and not by stylesheets. See also comments in Qt set contentsMargins from stylesheet and Qt remove margins

Post a Comment for "Qt Stylesheets - How To Remove Dead Space"