visualdynamics.gui¶
gui
¶
Desktop GUI. Start with visualdynamics-gui [files...] or python -m visualdynamics.
Functions:
| Name | Description |
|---|---|
qt_binding |
Which Qt pyqtgraph is bound to, or None if it is still free. |
check_qt_binding |
Point pyqtgraph at the same Qt as the rest of the GUI, or explain. |
Functions:¶
qt_binding
¶
Which Qt pyqtgraph is bound to, or None if it is still free.
None means nothing has imported pyqtgraph yet, so importing visualdynamics's own widgets first will decide it in our favour.
Source code in src/visualdynamics/gui/__init__.py
check_qt_binding
¶
Point pyqtgraph at the same Qt as the rest of the GUI, or explain.
pyqtgraph binds to one Qt for the life of the process, chosen when it is
first imported: whichever binding is already in sys.modules, and
failing that its own order of preference, which puts PyQt6 ahead of
PySide6. Having PySide6 installed is not enough.
visualdynamics is a PySide6 application, so a pyqtgraph on any other binding hands
back plot widgets a PySide6 layout will not accept. That surfaced as
QSplitter.addWidget called with wrong argument types from deep inside
the main window, naming nothing useful.
So: import PySide6 first, which decides it in our favour whenever
pyqtgraph has not yet been imported. When it has — sdynpy imports it
with PyQt5 at import sdynpy — the choice cannot be undone, and all
that is left is to say so before a window is built out of the mismatch.