(self, config: str = "full", file: str | None = None)
| 21 | |
| 22 | class MainWindow(QMainWindow): |
| 23 | def __init__(self, config: str = "full", file: str | None = None): |
| 24 | super().__init__() |
| 25 | self._config = config |
| 26 | self.setWindowTitle("SLiCAP Schematic Capture") |
| 27 | self.resize(1200, 800) |
| 28 | |
| 29 | self._scene = SchematicScene() |
| 30 | self._build_library() # system symbols only at startup |
| 31 | self._view = SchematicView(self._scene) |
| 32 | self._current_path: Path | None = None |
| 33 | self._doc_props = DocumentProperties.new() |
| 34 | self._symbol_loop_name: str | None = None |
| 35 | self._dirty: bool = False |
| 36 | self._scene.data_changed.connect(lambda: setattr(self, '_dirty', True)) |
| 37 | |
| 38 | self.setCentralWidget(self._view) |
| 39 | |
| 40 | self._build_menu() |
| 41 | |
| 42 | if file is not None: |
| 43 | self._load_file(Path(file)) |
| 44 | |
| 45 | # ── menu ───────────────────────────────────────────────────────────────── |
| 46 |
nothing calls this directly
no test coverage detected