python.utils.pyqt5patcher module

PyQt5 to PySide 1 patcher, extending PySide2Patcher in sgtk.util.

class PyQt5Patcher(*args, **kwargs)

Bases: sphinx.ext.autodoc.importer._MockObject

Patch remaining PyQt5 binding after Qt.py for PySide 1.

So yes, this patcher is used specifically after Qt.py patched most of PyQt5 bindings for PySide2.

It patches any remaining (Py)Qt5 bindings for PySide 1 since that’s what Shotgun still seems to mainly target as of May 2019.

Originally developed for Katana 3.1 for use in tk-katana:

Katana 3.1 (PyQt5)
        |
        V
      Qt.py
      ^^^^^
        |
        | Converts PyQt5 for PySide2 compatibility
        V
 PySide2Patcher (parent class from sgtk.util)
 ^^^^^^^^^^^^^^
        |
        |  Converts PySide2 for PySide 1 compatibility
        V
   PyQt5Patcher (that's me!)
   ^^^^^^^^^^^^
        |
        |  Converts any remaining PyQt5 for PySide 1 compatibility
        V
   KatanaEngine._define_qt_base
   ^^^^^^^^^^^^
        |
        |  Engine then exposes Qt bindings publicly through...
        V
 sgtk.platform.qt
classmethod patch(QtCore, QtGui, QtWidgets)

Patches QtCore, QtGui and QtWidgets

Parameters:
  • QtCore (module) – The QtCore module to patch.
  • QtGui (module) – The QtGui module to patch.
  • QtWidgets (module) – The QtWidgets module to patch.
class PatchedBoundSignal(original_signal)

Bases: object

Wrap original PyQt BoundSignal signal instances.

original_signal

Original, wrapped signal.

Type:PyQt5.BoundSignal