def add_option_group(self, group_label=None, checked=None, group_alignment=None, **kw): if group_label is None: grouping_widget = QWidget() else: grouping_widget = QGroupBox(group_label) grouping_widget.setContentsMargins( 1, grouping_widget.contentsMargins().top() // 2, 1, 1) if checked is not None: grouping_widget.setCheckable(True) grouping_widget.setChecked(checked) add_kw = {} if group_alignment is None else { 'alignment': group_alignment } self._layout.addWidget(grouping_widget, **add_kw) suboptions = OptionsPanel(scrolled=False, **kw) self._option_groups.append(suboptions) return grouping_widget, suboptions