from PyQt5.QtWidgets import * QLayout.setMargin = lambda self, m: self.setContentsMargins(m, m, m, m)