diff --git a/prettyqt/widgets/widget.py b/prettyqt/widgets/widget.py index 5810844d4..a88dc28ab 100644 --- a/prettyqt/widgets/widget.py +++ b/prettyqt/widgets/widget.py @@ -28,6 +28,11 @@ class WidgetMixin(core.ObjectMixin): box: QtWidgets.QLayout + def __init__(self, *args, margin: int | None = None, **kwargs): + super().__init__(*args, **kwargs) + if margin is not None: + self.set_margin(margin) + def _get_map(self): maps = super()._get_map() maps |= {