diff --git a/Qt.py b/Qt.py index a64d73e4..d73bd4b9 100644 --- a/Qt.py +++ b/Qt.py @@ -111,7 +111,7 @@ "QFileSystemWatcher", "QGenericArgument", "QGenericReturnArgument", - "QHistoryState", + "QItemSelection", "QItemSelectionRange", "QIODevice", "QLibraryInfo", @@ -925,6 +925,9 @@ def createWidget(self, class_name, parent=None, name=""): These members from the original submodule are misplaced relative PySide2 +NOTE: For bindings where a member is not replaced, they still + need to be added such that they are added to Qt.py + """ _misplaced_members = { "PySide6": { @@ -967,6 +970,9 @@ def createWidget(self, class_name, parent=None, name=""): "QtCore.Property": "QtCore.Property", "QtCore.Signal": "QtCore.Signal", "QtCore.Slot": "QtCore.Slot", + "QtCore.QRegExp": "QtCore.QRegExp", + "QtWidgets.QShortcut": "QtWidgets.QShortcut", + "QtGui.QRegExpValidator": "QtGui.QRegExpValidator", "QtCore.QAbstractProxyModel": "QtCore.QAbstractProxyModel", "QtCore.QSortFilterProxyModel": "QtCore.QSortFilterProxyModel", "QtCore.QItemSelection": "QtCore.QItemSelection", @@ -998,6 +1004,8 @@ def createWidget(self, class_name, parent=None, name=""): "sip.unwrapinstance": ["QtCompat.getCppPointer", _getcpppointer], "sip.isdeleted": ["QtCompat.isValid", _isvalid], "QtWidgets.qApp": "QtWidgets.QApplication.instance()", + "QtGui.QRegExpValidator": "QtGui.QRegExpValidator", + "QtCore.QRegExp": "QtCore.QRegExp", "QtCore.QCoreApplication.translate": [ "QtCompat.translate", _translate ], @@ -1007,6 +1015,7 @@ def createWidget(self, class_name, parent=None, name=""): "QtCore.qInstallMessageHandler": [ "QtCompat.qInstallMessageHandler", _qInstallMessageHandler ], + "QtWidgets.QShortcut": "QtWidgets.QShortcut", "QtWidgets.QStyleOptionViewItem": "QtCompat.QStyleOptionViewItemV4", "QtMultimedia.QSound": "QtMultimedia.QSound", }, @@ -1018,18 +1027,21 @@ def createWidget(self, class_name, parent=None, name=""): "QtGui.QItemSelectionModel": "QtCore.QItemSelectionModel", "QtGui.QItemSelectionRange": "QtCore.QItemSelectionRange", "QtGui.QAbstractPrintDialog": "QtPrintSupport.QAbstractPrintDialog", + "QtGui.QRegExpValidator": "QtGui.QRegExpValidator", "QtGui.QPageSetupDialog": "QtPrintSupport.QPageSetupDialog", "QtGui.QPrintDialog": "QtPrintSupport.QPrintDialog", "QtGui.QPrintEngine": "QtPrintSupport.QPrintEngine", "QtGui.QPrintPreviewDialog": "QtPrintSupport.QPrintPreviewDialog", "QtGui.QPrintPreviewWidget": "QtPrintSupport.QPrintPreviewWidget", "QtGui.QPrinter": "QtPrintSupport.QPrinter", + "QtWidgets.QShortcut": "QtWidgets.QShortcut", "QtGui.QPrinterInfo": "QtPrintSupport.QPrinterInfo", "QtUiTools.QUiLoader": ["QtCompat.loadUi", _loadUi], "shiboken.wrapInstance": ["QtCompat.wrapInstance", _wrapinstance], "shiboken.unwrapInstance": ["QtCompat.getCppPointer", _getcpppointer], "shiboken.isValid": ["QtCompat.isValid", _isvalid], "QtGui.qApp": "QtWidgets.QApplication.instance()", + "QtCore.QRegExp": "QtCore.QRegExp", "QtCore.QCoreApplication.translate": [ "QtCompat.translate", _translate ], @@ -1053,9 +1065,11 @@ def createWidget(self, class_name, parent=None, name=""): "QtCore.pyqtSlot": "QtCore.Slot", "QtGui.QItemSelectionRange": "QtCore.QItemSelectionRange", "QtGui.QAbstractPrintDialog": "QtPrintSupport.QAbstractPrintDialog", + "QtGui.QRegExpValidator": "QtGui.QRegExpValidator", "QtGui.QPageSetupDialog": "QtPrintSupport.QPageSetupDialog", "QtGui.QPrintDialog": "QtPrintSupport.QPrintDialog", "QtGui.QPrintEngine": "QtPrintSupport.QPrintEngine", + "QtWidgets.QShortcut": "QtWidgets.QShortcut", "QtGui.QPrintPreviewDialog": "QtPrintSupport.QPrintPreviewDialog", "QtGui.QPrintPreviewWidget": "QtPrintSupport.QPrintPreviewWidget", "QtGui.QPrinter": "QtPrintSupport.QPrinter", @@ -1066,6 +1080,7 @@ def createWidget(self, class_name, parent=None, name=""): "sip.isdeleted": ["QtCompat.isValid", _isvalid], "QtCore.QString": "str", "QtGui.qApp": "QtWidgets.QApplication.instance()", + "QtCore.QRegExp": "QtCore.QRegExp", "QtCore.QCoreApplication.translate": [ "QtCompat.translate", _translate ], @@ -1297,6 +1312,8 @@ def _reassign_misplaced_members(binding): """ + print(binding, "HALLO?") + for src, dst in _misplaced_members[binding].items(): dst_value = None @@ -1315,6 +1332,8 @@ def _reassign_misplaced_members(binding): if len(dst_parts) > 1: dst_member = dst_parts[1] + print("replacing %s.%s -> %s.%s" % (src_module, src_member, dst_module, dst_member)) + # Get the member we want to store in the namesapce. if not dst_value: try: @@ -1539,6 +1558,7 @@ def _pyside2(): Qt.QtCompat.setSectionResizeMode = \ Qt._QtWidgets.QHeaderView.setSectionResizeMode + print("ARADFA") _reassign_misplaced_members("PySide2") _build_compatibility_members("PySide2") @@ -1910,6 +1930,7 @@ def _install(): b for b in QT_PREFERRED_BINDING.split(os.pathsep) if b ) + print("Installing Qt.py") order = preferred_order or default_order available = { @@ -1995,6 +2016,7 @@ def _install(): Qt.QtCompat.load_ui = Qt.QtCompat.loadUi +print("RSHRFJsndfljsdnjk") _install() # Setup Binding Enum states