Skip to content

Commit

Permalink
feat(Widget): allow setting margin in ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed May 25, 2023
1 parent c4d055d commit d4e7c8e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions prettyqt/widgets/widget.py
Expand Up @@ -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 |= {
Expand Down

0 comments on commit d4e7c8e

Please sign in to comment.