(self)
| 855 | QMessageBox.critical(self, "Export SVG failed", str(exc)) |
| 856 | |
| 857 | def _on_export_pdf(self): |
| 858 | path, _ = QFileDialog.getSaveFileName( |
| 859 | self, "Export PDF", self._default_export_path("img", ".pdf"), |
| 860 | "PDF (*.pdf);;All Files (*)" |
| 861 | ) |
| 862 | if not path: |
| 863 | return |
| 864 | p = Path(path) |
| 865 | if p.suffix.lower() != ".pdf": |
| 866 | p = p.with_suffix(".pdf") |
| 867 | from .export import export_pdf |
| 868 | from .canvas import SchematicScene |
| 869 | try: |
| 870 | fresh = SchematicScene() |
| 871 | fresh.from_data(self._scene.to_data(), self._library) |
| 872 | export_pdf(fresh, p) |
| 873 | except Exception as exc: |
| 874 | QMessageBox.critical(self, "Export PDF failed", str(exc)) |
| 875 | |
| 876 | def _on_print(self): |
| 877 | from .export import print_scene |
nothing calls this directly
no test coverage detected