python.utils.qtpyimporter module

Qt Importer using Qt.Py to first convert to PySide2 bindings.

class QtPyImporter(qt=None, interface_version_requested=<sphinx.ext.autodoc.importer._MockObject object>)

Bases: sphinx.ext.autodoc.importer._MockObject

Extend QtImporter to use Qt.py.

Due to our patcher and Qt.py is local to tk_katana, this class is defined within this method to utilise modules imported by the engine’s import_module().

logger

Standard Python logger for this Importer.

Type:logging.Logger
interface_version_requested

Qt interface version requested during construction.

Type:int
base

Mapping of Qt module, class and bindings names.

Type:dict[str]
To Do:
Refactor and upstream our attributes to sgtk.util.qt_importer.QtImporter.
base

Extends the parent property for older, Qt4 based interfaces.

The parent QtImporter.base seems to only be used exclusively when interface_version_requested was Qt5.

To make it useful for older Qt4 interfaces, the following common mappings are used instead for Qt4 as inspired by tank.platform.engine.Engine._define_qt_base :

  • “qt_core”, QtCore module to use
  • “qt_gui”, QtGui module to use
  • “wrapper”, Qt wrapper root module, e.g. PySide
  • “dialog_base”, base class for Tank’s dialog factory.
Returns:Mapping of Qt module, class and bindings names.
Return type:dict[str]
interface_version_requested

Get the interface version requested during construction.

Returns:Qt interface version requested during construction.
Return type:int
logger

Get the Python logger

Returns:Standard Python logger for this importer.
Return type:logging.Logger