Netninja Qt Compat
Goal
Select the correct GUI backend at runtime (auto/Qt6/Qt5), guard imports to avoid crashes, and keep requirements consistent with the selected backend.
Read First
- •
cpu_features.pyfor SSE4.1/4.2 detection - •
main.pyandnetreaper_gui.pyfor startup flow - •
netreaper_gui_legacy.pyfor legacy GUI entry - •
launch_gui.bat,launch_gui.ps1for CLI surfaces - •
requirements.txt,requirements_legacy.txt,requirements_windows.txt
Workflow
- •Decide backend selection rules:
- •
--gui=qt6forces Qt6. - •
--gui=qt5forces Qt5. - •
--gui=autousescpu_features.pyand forces Qt5 if SSE4.1 or SSE4.2 is missing.
- •
- •Centralize selection logic in one function (e.g.,
select_gui_backend) that returns backend + reason. - •Enforce import order: never import PyQt6 before the selection decision. Use conditional or local imports after selecting backend.
- •Log the decision clearly (backend + reason) before GUI startup.
- •Keep requirements aligned: Qt6 in modern requirements, Qt5 in legacy requirements. Ensure launcher docs reflect the CLI flag.
- •Add a simple diagnostic command or log line that shows the detected CPU features and selected backend.
Output Expectations
- •Runtime decision is deterministic and logged.
- •Legacy CPUs never attempt PyQt6 import.
- •CLI flag override works on all launch surfaces.