MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / _qt_app

Function _qt_app

SLiCAP/schematic/cli.py:25–35  ·  view source on GitHub ↗

Return (or create) a headless QApplication. Only sets QT_QPA_PLATFORM=offscreen when there is no existing app — never when called from inside a running GUI, because that would corrupt the parent's environment and cause all subsequent subprocesses to be invisible.

()

Source from the content-addressed store, hash-verified

23# ── Qt bootstrap ─────────────────────────────────────────────────────────────
24
25def _qt_app():
26 """Return (or create) a headless QApplication.
27
28 Only sets QT_QPA_PLATFORM=offscreen when there is no existing app — never
29 when called from inside a running GUI, because that would corrupt the
30 parent's environment and cause all subsequent subprocesses to be invisible.
31 """
32 from PySide6.QtWidgets import QApplication
33 if QApplication.instance() is None:
34 os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
35 return QApplication.instance() or QApplication(sys.argv[:1])
36
37
38# ── shared scene loader ───────────────────────────────────────────────────────

Callers 3

cmd_netlistFunction · 0.85
cmd_svgFunction · 0.85
cmd_pdfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected