diff options
Diffstat (limited to 'sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py')
-rw-r--r-- | sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py | 326 |
1 files changed, 192 insertions, 134 deletions
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py index 2f4104945..944a928e6 100644 --- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py +++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py @@ -1,41 +1,7 @@ -############################################################################# -## -## Copyright (C) 2019 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of Qt for Python. -## -## $QT_BEGIN_LICENSE:LGPL$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 3 as published by the Free Software -## Foundation and appearing in the file LICENSE.LGPL3 included in the -## packaging of this file. Please review the following information to -## ensure the GNU Lesser General Public License version 3 requirements -## will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 2.0 or (at your option) the GNU General -## Public license version 3 or any later version approved by the KDE Free -## Qt Foundation. The licenses are as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-2.0.html and -## https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +# flake8: noqa E:203 """ mapping.py @@ -47,23 +13,24 @@ The PySide modules are not loaded in advance, but only after they appear in sys.modules. This minimizes the loading overhead. """ -import sys -import struct import os +import struct +import sys +import typing + from pathlib import Path +from typing import TypeVar, Generic +from _imp import is_builtin -from shibokensupport.signature import typing -from shibokensupport.signature.typing import TypeVar, Generic -from shibokensupport.signature.lib.tool import with_metaclass class ellipsis(object): def __repr__(self): return "..." + ellipsis = ellipsis() -Point = typing.Tuple[float, float] +Point = typing.Tuple[int, int] Variant = typing.Any -ModelIndexList = typing.List[int] QImageCleanupFunction = typing.Callable # unfortunately, typing.Optional[t] expands to typing.Union[t, NoneType] @@ -75,7 +42,7 @@ _S = TypeVar("_S") MultiMap = typing.DefaultDict[str, typing.List[str]] # ulong_max is only 32 bit on windows. -ulong_max = 2*sys.maxsize+1 if len(struct.pack("L", 1)) != 4 else 0xffffffff +ulong_max = 2 * sys.maxsize + 1 if len(struct.pack("L", 1)) != 4 else 0xffffffff ushort_max = 0xffff GL_COLOR_BUFFER_BIT = 0x00004000 @@ -111,6 +78,7 @@ class _NotCalled(str): text = self if self.endswith(")") else self + "()" return eval(text, namespace) + USE_PEP563 = False # Note: we cannot know if this feature has been imported. # Otherwise it would be "sys.version_info[:2] >= (3, 7)". @@ -123,6 +91,7 @@ USE_PEP563 = False class Virtual(_NotCalled): pass + # Other types I simply could not find. class Missing(_NotCalled): # The string must be quoted, because the object does not exist. @@ -135,6 +104,7 @@ class Missing(_NotCalled): class Invalid(_NotCalled): pass + # Helper types class Default(_NotCalled): pass @@ -143,6 +113,7 @@ class Default(_NotCalled): class Instance(_NotCalled): pass + # Parameterized primitive variables class _Parameterized(object): def __init__(self, type): @@ -152,15 +123,18 @@ class _Parameterized(object): def __repr__(self): return f"{type(self).__name__}({self.type.__name__})" + # Mark the primitive variables to be moved into the result. class ResultVariable(_Parameterized): pass + # Mark the primitive variables to become Sequence, Iterable or List # (decided in the parser). class ArrayLikeVariable(_Parameterized): pass + StringList = ArrayLikeVariable(str) @@ -179,7 +153,7 @@ class Reloader(object): if getattr(mod, "__file__", None) and not Path(mod.__file__).is_dir(): ending = Path(mod.__file__).suffix return ending not in (".py", ".pyc", ".pyo", ".pyi") - return False + return bool(hasattr(mod, "__name__") and is_builtin(mod.__name__)) def update(self): """ @@ -217,23 +191,29 @@ def check_module(mod): mod_name = mod.__name__ raise ImportError(f"Module '{mod_name}' is not a binary module!") + update_mapping = Reloader().update type_map = {} namespace = globals() # our module's __dict__ type_map.update({ "...": ellipsis, + "Any": typing.Any, "bool": bool, "char": int, - "char*": str, - "char*const": str, "double": float, "float": float, "int": int, "List": ArrayLikeVariable, + "Optional": typing.Optional, "long": int, + "long long": int, + "nullptr": None, "PyCallable": typing.Callable, "PyObject": object, + "PyObject*": object, + "PyArrayObject": ArrayLikeVariable, # numpy + "PyPathLike": typing.Union[str, bytes, os.PathLike[str]], "PySequence": typing.Iterable, # important for numpy "PyTypeObject": type, "QChar": str, @@ -242,16 +222,26 @@ type_map.update({ "qint32": int, "qint64": int, "qint8": int, + "int16_t": int, + "int32_t": int, + "int64_t": int, + "int8_t": int, + "intptr_t": int, + "uintptr_t": int, "qintptr": int, "qsizetype": int, + "QFunctionPointer": int, "QList": ArrayLikeVariable, "qlonglong": int, "QMap": typing.Dict, + "QMultiHash": typing.Dict, + "QMultiMap": typing.Dict, "QPair": typing.Tuple, "qptrdiff": int, "qreal": float, "QSet": typing.Set, "QString": str, + "QLatin1String": str, "QStringView": str, "QStringList": StringList, "quint16": int, @@ -259,6 +249,11 @@ type_map.update({ "quint32": int, "quint64": int, "quint8": int, + "uint16_t": int, + "uint32_t": int, + "uint64_t": int, + "uint8_t": int, + "Union": typing.Union, "quintptr": int, "qulonglong": int, "QVariant": Variant, @@ -270,7 +265,10 @@ type_map.update({ "signed long": int, "std.list": typing.List, "std.map": typing.Dict, + "std.nullptr_t": NoneType, "std.pair": typing.Tuple, + "std.string": str, + "std.wstring": str, "std.vector": typing.List, "str": str, "true": True, @@ -280,17 +278,17 @@ type_map.update({ "uint": int, "ulong": int, "ULONG_MAX": ulong_max, - "unsigned char": int, # 5.9 + "UINT64_MAX": 0xffffffff, + "unsigned char": int, # 5.9 "unsigned char*": str, "unsigned int": int, - "unsigned long int": int, # 5.6, RHEL 6.6 + "unsigned long int": int, # 5.6, RHEL 6.6 "unsigned long long": int, "unsigned long": int, - "unsigned short int": int, # 5.6, RHEL 6.6 + "unsigned short int": int, # 5.6, RHEL 6.6 "unsigned short": int, - "Unspecified": None, "ushort": int, - "void": int, # be more specific? + "void": int, # be more specific? "WId": WId, "zero(bytes)": b"", "zero(Char)": 0, @@ -299,7 +297,12 @@ type_map.update({ "zero(object)": None, "zero(str)": "", "zero(typing.Any)": None, - }) + "zero(Any)": None, + # This can be refined by importing numpy.typing optionally, but better than nothing. + "numpy.ndarray": typing.List[typing.Any], + "std.array[int, 4]": typing.List[int], + "std.array[float, 4]": typing.List[float] +}) type_map.update({ # Handling variables declared as array: @@ -311,21 +314,29 @@ type_map.update({ "array long long*" : ArrayLikeVariable(int), "array long*" : ArrayLikeVariable(int), "array short*" : ArrayLikeVariable(int), - "array signed char*" : bytes, - "array unsigned char*" : bytes, + "array signed char*" : typing.Union[bytes, bytearray, memoryview], + "array unsigned char*" : typing.Union[bytes, bytearray, memoryview], "array unsigned int*" : ArrayLikeVariable(int), "array unsigned short*" : ArrayLikeVariable(int), - }) + # PYSIDE-1646: New macOS primitive types + "array int8_t*" : ArrayLikeVariable(int), + "array uint8_t*" : ArrayLikeVariable(int), + "array int16_t*" : ArrayLikeVariable(int), + "array uint16_t*" : ArrayLikeVariable(int), + "array int32_t*" : ArrayLikeVariable(int), + "array uint32_t*" : ArrayLikeVariable(int), + "array intptr_t*" : ArrayLikeVariable(int), +}) type_map.update({ # Special cases: - "char*" : bytes, - "QChar*" : bytes, + "char*" : typing.Union[bytes, bytearray, memoryview], + "QChar*" : typing.Union[bytes, bytearray, memoryview], "quint32*" : int, # only for QRandomGenerator "quint8*" : bytearray, # only for QCborStreamReader and QCborValue - "uchar*" : bytes, - "unsigned char*": bytes, - }) + "uchar*" : typing.Union[bytes, bytearray, memoryview], + "unsigned char*": typing.Union[bytes, bytearray, memoryview], +}) type_map.update({ # Handling variables that are returned, eventually as Tuples: @@ -339,6 +350,7 @@ type_map.update({ "qint32*" : ResultVariable(int), "qint64*" : ResultVariable(int), "qreal*" : ResultVariable(float), + "qsizetype*" : ResultVariable(int), "QString*" : ResultVariable(str), "qintptr*" : ResultVariable(int), "quintptr*" : ResultVariable(int), @@ -346,11 +358,26 @@ type_map.update({ "uint*" : ResultVariable(int), "unsigned int*" : ResultVariable(int), "QStringList*" : ResultVariable(StringList), - }) +}) + + +type_map.update({ + # Hack, until improving the parser: + "[typing.Any]" : [typing.Any], + "[typing.Any,typing.Any]" : [typing.Any, typing.Any], + "None" : None, +}) + # PYSIDE-1328: We need to handle "self" explicitly. type_map.update({ - "self" : "self", + "self" : "self", + "cls" : "cls", +}) + +# PYSIDE-1538: We need to treat "std::optional" accordingly. +type_map.update({ + "std.optional": typing.Optional, }) @@ -363,6 +390,7 @@ def init_Shiboken(): }) return locals() + def init_minimal(): type_map.update({ "MinBool": bool, @@ -375,16 +403,18 @@ def init_sample(): type_map.update({ "char": int, "char**": typing.List[str], + "const char*": str, "Complex": complex, "double": float, + "ByteArray&": typing.Union[bytes, bytearray, memoryview], "Foo.HANDLE": int, "HANDLE": int, "Null": None, - "nullptr": None, "ObjectType.Identifier": Missing("sample.ObjectType.Identifier"), "OddBool": bool, "PStr": str, "PyDate": datetime.date, + "PyBuffer": typing.Union[bytes, bytearray, memoryview], "sample.bool": bool, "sample.char": int, "sample.double": float, @@ -395,6 +425,7 @@ def init_sample(): "sample.Photon.TemplateBase[Photon.IdentityType]": sample.Photon.ValueIdentity, "sample.Point": Point, "sample.PStr": str, + "SampleNamespace.InValue.ZeroIn": 0, "sample.unsigned char": int, "std.size_t": int, "std.string": str, @@ -419,6 +450,7 @@ def init_smart(): # This missing type should be defined in module smart. We cannot set it to Missing() # because it is a container type. Therefore, we supply a surrogate: global SharedPtr + class SharedPtr(Generic[_S]): __module__ = "smart" smart.SharedPtr = SharedPtr @@ -430,9 +462,10 @@ def init_smart(): # The PySide Part def init_PySide6_QtCore(): - from PySide6.QtCore import Qt, QUrl, QDir - from PySide6.QtCore import QRect, QSize, QPoint, QLocale, QByteArray - from PySide6.QtCore import QMarginsF # 5.9 + from PySide6.QtCore import Qt, QUrl, QDir, QKeyCombination + from PySide6.QtCore import QRect, QRectF, QSize, QPoint, QLocale, QByteArray + from PySide6.QtCore import QMarginsF # 5.9 + from PySide6.QtCore import SignalInstance try: # seems to be not generated by 5.9 ATM. from PySide6.QtCore import Connection @@ -442,56 +475,69 @@ def init_PySide6_QtCore(): "' '": " ", "'%'": "%", "'g'": "g", - "4294967295UL": 4294967295, # 5.6, RHEL 6.6 + "4294967295UL": 4294967295, # 5.6, RHEL 6.6 "CheckIndexOption.NoOption": Instance( - "PySide6.QtCore.QAbstractItemModel.CheckIndexOptions.NoOption"), # 5.11 + "PySide6.QtCore.QAbstractItemModel.CheckIndexOptions.NoOption"), # 5.11 "DescriptorType(-1)": int, # Native handle of QSocketDescriptor "false": False, "list of QAbstractAnimation": typing.List[PySide6.QtCore.QAbstractAnimation], "long long": int, "size_t": int, - "NULL": None, # 5.6, MSVC - "nullptr": None, # 5.9 + "NULL": None, # 5.6, MSVC + "nullptr": None, # 5.9 + "PyBuffer": typing.Union[bytes, bytearray, memoryview], "PyByteArray": bytearray, - "PyBytes": bytes, + "PyBytes": typing.Union[bytes, bytearray, memoryview], + "PyTuple": typing.Tuple, "QDeadlineTimer(QDeadlineTimer.Forever)": Instance("PySide6.QtCore.QDeadlineTimer"), "PySide6.QtCore.QUrl.ComponentFormattingOptions": - PySide6.QtCore.QUrl.ComponentFormattingOption, # mismatch option/enum, why??? + PySide6.QtCore.QUrl.ComponentFormattingOption, # mismatch option/enum, why??? "PyUnicode": typing.Text, + "QByteArrayView": QByteArray, "Q_NULLPTR": None, + "QCalendar.Unspecified": PySide6.QtCore.QCalendar.Unspecified, + "QCborTag(-1)": ulong_max, "QDir.Filters(AllEntries | NoDotAndDotDot)": Instance( "QDir.Filters(QDir.AllEntries | QDir.NoDotAndDotDot)"), "QDir.SortFlags(Name | IgnoreCase)": Instance( "QDir.SortFlags(QDir.Name | QDir.IgnoreCase)"), - "QGenericArgument((0))": ellipsis, # 5.6, RHEL 6.6. Is that ok? + "QEvent.Type.None": None, + "QGenericArgument((0))": ellipsis, # 5.6, RHEL 6.6. Is that ok? "QGenericArgument()": ellipsis, "QGenericArgument(0)": ellipsis, - "QGenericArgument(NULL)": ellipsis, # 5.6, MSVC - "QGenericArgument(nullptr)": ellipsis, # 5.10 + "QGenericArgument(NULL)": ellipsis, # 5.6, MSVC + "QGenericArgument(nullptr)": ellipsis, # 5.10 "QGenericArgument(Q_NULLPTR)": ellipsis, "QJsonObject": typing.Dict[str, PySide6.QtCore.QJsonValue], - "QModelIndex()": Invalid("PySide6.QtCore.QModelIndex"), # repr is btw. very wrong, fix it?! - "QModelIndexList": ModelIndexList, - "QModelIndexList": ModelIndexList, + "QModelIndex()": Invalid("PySide6.QtCore.QModelIndex"), # repr is btw. very wrong, fix it?! + "QModelIndexList": typing.List[PySide6.QtCore.QModelIndex], + "PySideSignalInstance": SignalInstance, "QString()": "", + "Flag.Default": Instance("PySide6.QtCore.QStringConverterBase.Flags"), "QStringList()": [], "QStringRef": str, "QStringRef": str, - "Qt.HANDLE": int, # be more explicit with some constants? + "Qt.HANDLE": int, # be more explicit with some constants? "QUrl.FormattingOptions(PrettyDecoded)": Instance( "QUrl.FormattingOptions(QUrl.PrettyDecoded)"), "QVariant()": Invalid(Variant), - "QVariant.Type": type, # not so sure here... - "QVariantMap": typing.Dict[str, Variant], + "QVariant.Type": type, # not so sure here... "QVariantMap": typing.Dict[str, Variant], + "std.chrono.seconds{5}" : ellipsis, }) try: type_map.update({ - "PySide6.QtCore.QMetaObject.Connection": PySide6.QtCore.Connection, # wrong! + "PySide6.QtCore.QMetaObject.Connection": PySide6.QtCore.Connection, # wrong! }) except AttributeError: # this does not exist on 5.9 ATM. pass + + # special case - char* can either be 'bytes' or 'str'. The default is 'bytes'. + # Here we manually set it to map to 'str'. + type_map.update({("PySide6.QtCore.QObject.setProperty", "char*"): str}) + type_map.update({("PySide6.QtCore.QObject.property", "char*"): str}) + return locals() @@ -506,37 +552,48 @@ def init_PySide6_QtConcurrent(): def init_PySide6_QtGui(): - from PySide6.QtGui import QPageLayout, QPageSize # 5.12 macOS + from PySide6.QtGui import QPageLayout, QPageSize # 5.12 macOS type_map.update({ "0.0f": 0.0, "1.0f": 1.0, "GL_COLOR_BUFFER_BIT": GL_COLOR_BUFFER_BIT, "GL_NEAREST": GL_NEAREST, "int32_t": int, - "QPixmap()": Default("PySide6.QtGui.QPixmap"), # can't create without qApp - "QPlatformSurface*": int, # a handle - "QVector< QTextLayout.FormatRange >()": [], # do we need more structure? + "HBITMAP": int, + "HICON": int, + "HMONITOR": int, + "HRGN": int, + "QPixmap()": Default("PySide6.QtGui.QPixmap"), # can't create without qApp + "QPlatformSurface*": int, # a handle + "QVector< QTextLayout.FormatRange >()": [], # do we need more structure? "uint32_t": int, "uint8_t": int, "USHRT_MAX": ushort_max, }) + + # special case - char* can either be 'bytes' or 'str'. The default is 'bytes'. + # Here we manually set it to map to 'str'. + type_map.update({("PySide6.QtGui.QPixmap.save", "char*"): str}) + return locals() def init_PySide6_QtWidgets(): - from PySide6.QtWidgets import QWidget, QMessageBox, QStyleOption, QStyleHintReturn, QStyleOptionComplex - from PySide6.QtWidgets import QGraphicsItem, QStyleOptionGraphicsItem # 5.9 + from PySide6.QtWidgets import (QWidget, QMessageBox, QStyleOption, + QStyleHintReturn, QStyleOptionComplex, + QGraphicsItem, QStyleOptionGraphicsItem) type_map.update({ "QMessageBox.StandardButtons(Yes | No)": Instance( "QMessageBox.StandardButtons(QMessageBox.Yes | QMessageBox.No)"), "QWidget.RenderFlags(DrawWindowBackground | DrawChildren)": Instance( "QWidget.RenderFlags(QWidget.DrawWindowBackground | QWidget.DrawChildren)"), - "SH_Default": QStyleHintReturn.SH_Default, - "SO_Complex": QStyleOptionComplex.SO_Complex, - "SO_Default": QStyleOption.SO_Default, "static_cast<Qt.MatchFlags>(Qt.MatchExactly|Qt.MatchCaseSensitive)": Instance( "Qt.MatchFlags(Qt.MatchExactly | Qt.MatchCaseSensitive)"), - "Type": PySide6.QtWidgets.QListWidgetItem.Type, + "static_cast<Qt.MatchFlag>(Qt.MatchExactly|Qt.MatchCaseSensitive)": Instance( + "Qt.MatchFlag(Qt.MatchExactly | Qt.MatchCaseSensitive)"), + "QListWidgetItem.ItemType.Type": PySide6.QtWidgets.QListWidgetItem.Type, + "QTableWidgetItem.ItemType.Type": PySide6.QtWidgets.QTableWidgetItem.Type, + "QTreeWidgetItem.ItemType.Type": PySide6.QtWidgets.QTreeWidgetItem.Type, }) return locals() @@ -544,14 +601,14 @@ def init_PySide6_QtWidgets(): def init_PySide6_QtSql(): from PySide6.QtSql import QSqlDatabase type_map.update({ - "QLatin1String(defaultConnection)": QSqlDatabase.defaultConnection, - "QVariant.Invalid": Invalid("Variant"), # not sure what I should create, here... + "QLatin1StringView(QSqlDatabase.defaultConnection)": QSqlDatabase.defaultConnection, + "QVariant.Invalid": Invalid("Variant"), # not sure what I should create, here... }) return locals() def init_PySide6_QtNetwork(): - from PySide6.QtNetwork import QNetworkRequest + from PySide6.QtNetwork import QNetworkRequest, QHostAddress best_structure = typing.OrderedDict if getattr(typing, "OrderedDict", None) else typing.Dict type_map.update({ "QMultiMap[PySide6.QtNetwork.QSsl.AlternativeNameEntryType, QString]": @@ -565,32 +622,11 @@ def init_PySide6_QtNetwork(): return locals() -def init_PySide6_QtXmlPatterns(): - from PySide6.QtXmlPatterns import QXmlName - type_map.update({ - "QXmlName.NamespaceCode": Missing("PySide6.QtXmlPatterns.QXmlName.NamespaceCode"), - "QXmlName.PrefixCode": Missing("PySide6.QtXmlPatterns.QXmlName.PrefixCode"), - }) - return locals() - - -def init_PySide6_QtMultimedia(): - import PySide6.QtMultimediaWidgets - # Check if foreign import is valid. See mapping.py in shiboken6. - check_module(PySide6.QtMultimediaWidgets) - type_map.update({ - "QGraphicsVideoItem": PySide6.QtMultimediaWidgets.QGraphicsVideoItem, - "qint64": int, - "QVideoWidget": PySide6.QtMultimediaWidgets.QVideoWidget, - }) - return locals() - - def init_PySide6_QtOpenGL(): type_map.update({ "GLbitfield": int, "GLenum": int, - "GLfloat": float, # 5.6, MSVC 15 + "GLfloat": float, # 5.6, MSVC 15 "GLint": int, "GLuint": int, }) @@ -599,8 +635,7 @@ def init_PySide6_QtOpenGL(): def init_PySide6_QtQml(): type_map.update({ - "QJSValueList()": [], - "QVariantHash()": typing.Dict[str, Variant], # from 5.9 + "VolatileBool": PySide6.QtQml.VolatileBool, }) return locals() @@ -609,35 +644,47 @@ def init_PySide6_QtQuick(): type_map.update({ "PySide6.QtQuick.QSharedPointer[PySide6.QtQuick.QQuickItemGrabResult]": PySide6.QtQuick.QQuickItemGrabResult, - "UnsignedShortType": int, + "QSGGeometry.Type.UnsignedShortType": int, }) return locals() -def init_PySide6_QtScript(): +def init_PySide6_QtTest(): + from PySide6.QtCore import SignalInstance type_map.update({ - "QScriptValueList()": [], + "PySideSignalInstance": SignalInstance, + "PySide6.QtTest.QTest.PySideQTouchEventSequence": PySide6.QtTest.QTest.QTouchEventSequence, + "PySide6.QtTest.QTouchEventSequence": PySide6.QtTest.QTest.QTouchEventSequence, }) return locals() -def init_PySide6_QtTest(): +# from 5.12, macOS +def init_PySide6_QtDataVisualization(): + from PySide6.QtDataVisualization import (QBarDataItem, QSurfaceDataItem) + QBarDataRow = typing.List[QBarDataItem] + QBarDataArray = typing.List[QBarDataRow] + QSurfaceDataRow = typing.List[QSurfaceDataItem] + QSurfaceDataArray = typing.List[QSurfaceDataRow] type_map.update({ - "PySide6.QtTest.QTest.PySideQTouchEventSequence": PySide6.QtTest.QTest.QTouchEventSequence, - "PySide6.QtTest.QTouchEventSequence": PySide6.QtTest.QTest.QTouchEventSequence, + "100.0f": 100.0, + "QBarDataArray": QBarDataArray, + "QBarDataArray*": QBarDataArray, + "QSurfaceDataArray": QSurfaceDataArray, + "QSurfaceDataArray*": QSurfaceDataArray, }) return locals() -# from 5.6, MSVC -def init_PySide6_QtWinExtras(): + +def init_PySide6_QtBluetooth(): type_map.update({ - "QList< QWinJumpListItem* >()": [], + "QVariant*": object, }) return locals() -# from 5.12, macOS -def init_PySide6_QtDataVisualization(): - from PySide6.QtDataVisualization import (QBarDataItem, QSurfaceDataItem) + +def init_PySide6_QtGraphs(): + from PySide6.QtGraphs import (QBarDataItem, QSurfaceDataItem) QBarDataRow = typing.List[QBarDataItem] QBarDataArray = typing.List[QBarDataRow] QSurfaceDataRow = typing.List[QSurfaceDataItem] @@ -652,9 +699,20 @@ def init_PySide6_QtDataVisualization(): return locals() +def init_PySide6_QtHttpServer(): + type_map.update({ + "qMakePair(1u, 1u)": (1, 1), + }) + return locals() + + def init_testbinding(): type_map.update({ "testbinding.PySideCPP2.TestObjectWithoutNamespace": testbinding.TestObjectWithoutNamespace, + "testbinding.FlagsNamespace.Options": testbinding.Option, + "FlagsNamespace.Option.NoOptions": 0, + "StdIntList": typing.List[int], + 'Str("")': str(""), }) return locals() |