rows = [(label, section, key, widget), ...]
(col: QVBoxLayout, title: str,
rows: list[tuple[str, str, str, object]])
| 123 | |
| 124 | # ── group builder ───────────────────────────────────────────────────── |
| 125 | def group(col: QVBoxLayout, title: str, |
| 126 | rows: list[tuple[str, str, str, object]]) -> None: |
| 127 | """rows = [(label, section, key, widget), ...]""" |
| 128 | grp = QGroupBox(title) |
| 129 | form = QFormLayout() |
| 130 | form.setLabelAlignment(Qt.AlignLeft | Qt.AlignVCenter) |
| 131 | form.setFormAlignment(Qt.AlignLeft | Qt.AlignTop) |
| 132 | form.setSpacing(4) |
| 133 | grp.setLayout(form) |
| 134 | for label, sec, key, widget in rows: |
| 135 | self._widgets[(sec, key)] = widget |
| 136 | if isinstance(widget, _ColorButton): |
| 137 | # Right-align colour buttons with a stretch spacer |
| 138 | h = QHBoxLayout() |
| 139 | h.setContentsMargins(0, 0, 0, 0) |
| 140 | h.addStretch(1) |
| 141 | h.addWidget(widget) |
| 142 | form.addRow(label, h) |
| 143 | else: |
| 144 | form.addRow(label, widget) |
| 145 | col.addWidget(grp) |
| 146 | |
| 147 | # ── left column ─────────────────────────────────────────────────────── |
| 148 | group(left, "Symbol", [ |
no outgoing calls
no test coverage detected