Skip to content

Commit

Permalink
Implement '_pyside6()'.
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-chatterjee committed Feb 26, 2024
1 parent 59aaf91 commit 491a3f2
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1472,6 +1472,50 @@ def _build_compatibility_members(binding, decorators=None):
setattr(Qt.QtCompat, classname, compat_class)


def _pyside6():
"""Initialise PySide6
These functions serve to test the existence of a binding
along with set it up in such a way that it aligns with
the final step; adding members from the original binding
to Qt.py
"""

import PySide6 as module
extras = ["QtUiTools"]
try:
import shiboken6
extras.append("shiboken6")
except ImportError as e:
print("ImportError: %s" % e)

_setup(module, extras)
Qt.__binding_version__ = module.__version__

if hasattr(Qt, "_shiboken6"):
Qt.QtCompat.wrapInstance = _wrapinstance
Qt.QtCompat.getCppPointer = _getcpppointer
Qt.QtCompat.delete = shiboken6.delete

if hasattr(Qt, "_QtUiTools"):
Qt.QtCompat.loadUi = _loadUi

if hasattr(Qt, "_QtCore"):
Qt.__qt_version__ = Qt._QtCore.qVersion()
Qt.QtCompat.dataChanged = (
lambda self, topleft, bottomright, roles=None:
self.dataChanged.emit(topleft, bottomright, roles or [])
)

if hasattr(Qt, "_QtWidgets"):
Qt.QtCompat.setSectionResizeMode = \
Qt._QtWidgets.QHeaderView.setSectionResizeMode

_reassign_misplaced_members("PySide6")
_build_compatibility_members("PySide6")


def _pyside2():
"""Initialise PySide2
Expand Down

0 comments on commit 491a3f2

Please sign in to comment.