MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / _make_pair

Function _make_pair

SLiCAP/schematic/properties_dialog.py:281–299  ·  view source on GitHub ↗

Create a linked (show-value, show-name) checkbox pair. 'show name' is disabled whenever 'show value' is off.

(sv_checked: bool, sn_checked: bool)

Source from the content-addressed store, hash-verified

279
280
281def _make_pair(sv_checked: bool, sn_checked: bool) -> tuple[QCheckBox, QCheckBox]:
282 """
283 Create a linked (show-value, show-name) checkbox pair.
284 'show name' is disabled whenever 'show value' is off.
285 """
286 sv = QCheckBox()
287 sn = QCheckBox()
288 sv.setChecked(sv_checked)
289 sn.setChecked(sn_checked)
290 sn.setEnabled(sv_checked)
291
292 def _on_sv(state):
293 enabled = bool(state)
294 sn.setEnabled(enabled)
295 if not enabled:
296 sn.setChecked(False)
297
298 sv.stateChanged.connect(_on_sv)
299 return sv, sn

Callers 3

__init__Method · 0.85
_rebuild_paramsMethod · 0.85
_rebuild_refsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected