nexxT.QtMetaPackage module
This module provides a QT meta package such that we are able to write “from nexxT.Qt.QtWidgets import QWidget” and nexxT.Qt will serve as an alias for PySide6
It is loosly based on this tutorial: https://dev.to/dangerontheranger/dependency-injection-with-import-hooks-in-python-3-5hap
- class nexxT.QtMetaPackage.QtFinder(loader)[source]
Bases:
MetaPathFinderThe meta path finder which will be added to sys.meta_path
- class nexxT.QtMetaPackage.QtLoader(prefix, qtlib)[source]
Bases:
LoaderThe actual loader which maps PySide modules to nexxT.Qt. The approach is similar to executing a
from PySide6 import *statement in a real Qt.py module, but it is dynamically and prevents from loading unused QT modules, like QtMultimedia, etc.- __init__(prefix, qtlib)[source]
Constructor.
- Parameters:
prefix – the prefix for the proxied library (e.g. nexxT.Qt)
qtlib – the PySide library to be used, must be PySide6
- create_module(spec)[source]
Creates a new module according to spec. It will be empty initially and populated during exec_module(…).
- Parameters:
spec – A ModuleSpec instance.