migrate pyqt5 to pyside6

This commit is contained in:
ykcheungab
2026-09-21 09:34:56 +08:00
parent e276b5de0f
commit ccedb9ddd9
66 changed files with 2184 additions and 395 deletions
+13 -4
View File
@@ -24,7 +24,7 @@ dist/
OrisysStudio/
OrisysStudio.exe
config/ # lean locales + sensors (no finger visualization/)
_internal/ # Python, PyQt5, opencv-headless, orisys, OpenGL, …
_internal/ # Python, PySide6, opencv-headless, orisys, OpenGL, …
```
## Why there are two steps
@@ -137,11 +137,20 @@ loaded" can only be printed if those modules imported.)
## Dependency notes
- App shared dep uses **`opencv-python-headless`** (PyQt owns the GUI). `setup.ps1` uninstalls
any `opencv-python` and pins `opencv-python-headless>=4.10,<5` (5.x has shipped wheels
without a `cv2` module) and verifies `import cv2`.
- **PySide6** is the Qt binding (LGPLv3). PyQt5 was replaced because its free option is
GPLv3-or-commercial; the apps are PySide6-only and their tests enforce it
(`apps/studio/tests/test_binding_purity.py`, `apps/autocal/tests/test_binding_purity.py`).
`setup.ps1` **uninstalls** PyQt5/PyQt6/PySide2 from the build venv and verifies only one
binding is present: `pyqtgraph` binds to whichever toolkit it imports first, so a leftover
PyQt5 yields a bundle whose plots were built from the wrong binding. The spec also excludes
`PyQt5`/`PyQt6`/`PySide2` outright, and must never exclude `PySide6` itself.
- App shared dep uses **`opencv-python-headless`** (PySide6 owns the GUI). `setup.ps1`
uninstalls any `opencv-python` and pins `opencv-python-headless>=4.10,<5` (5.x has shipped
wheels without a `cv2` module) and verifies `import cv2`.
- **PyOpenGL** is the GL binding for the 3D pane and comes from the studio's `three-d` extra.
Add the `protected-assets` extra (`cryptography`) if sealed `.oryscene` packages are shipped.
- **`QOpenGLWidget` lives in `PySide6.QtOpenGLWidgets`**, not `QtWidgets` (Qt6 moved it): the
spec names it in `hiddenimports` so the module and `Qt6OpenGLWidgets.dll` are bundled.
- **Open3D stays excluded** (spec + build env): it is an offline geometry tool. The 3D pane is
Qt `QOpenGLWidget` + PyOpenGL.
- `constraints-build.txt` pins the toolchain. Move a pin only together with `setup.bat -Force`