diff options
4 files changed, 12 insertions, 10 deletions
diff --git a/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml b/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml index a300f517c..c55afe590 100644 --- a/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml +++ b/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml @@ -2373,7 +2373,7 @@ <remove-argument/> </modify-argument> <modify-argument index="return"> - <replace-type modified-type="PyTupleObject*"/> + <replace-type modified-type="Tuple"/> </modify-argument> <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qmatrix4x4-copydatato"/> </modify-function> @@ -2636,7 +2636,7 @@ <inject-code file="../glue/qtgui.cpp" snippet="qguiapplication-exec"/> </add-function> <modify-function signature="setOverrideCursor(const QCursor&)"> - <modify-argument index="return"> + <modify-argument index="return" pyi-type="PyObject"> <replace-type modified-type="QtGuiHelper::QOverrideCursorGuard*"/> </modify-argument> <inject-code class="target" position="end" file="../glue/qtgui.cpp" diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp index a1e30dd21..8ce6189b8 100644 --- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp +++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp @@ -5485,12 +5485,13 @@ void CppGenerator::writeSignatureInfo(TextStream &s, const OverloadData &overloa if (multiple) s << idx-- << ':'; s << funcName << '(' << args.join(u',') << ')'; - if (!f->isVoid()) { - QString t = f->pyiTypeReplaced(0); - if (t.isEmpty()) - t = f->type().pythonSignature(); - s << "->" << t; - } + + QString returnType = f->pyiTypeReplaced(0); // pyi or modified type + if (returnType.isEmpty() && !f->isVoid()) + returnType = f->type().pythonSignature(); + if (!returnType.isEmpty()) + s << "->" << returnType; + s << '\n'; } } diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py index 2118d7e39..204f1a3d4 100644 --- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py +++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py @@ -238,6 +238,7 @@ type_map.update({ "uint32_t": int, "uint64_t": int, "uint8_t": int, + "Union": typing.Union, "quintptr": int, "qulonglong": int, "QVariant": Variant, @@ -440,7 +441,7 @@ def init_smart(): # The PySide Part def init_PySide6_QtCore(): from PySide6.QtCore import Qt, QUrl, QDir, QKeyCombination - from PySide6.QtCore import QRect, QSize, QPoint, QLocale, QByteArray + from PySide6.QtCore import QRect, QRectF, QSize, QPoint, QLocale, QByteArray from PySide6.QtCore import QMarginsF # 5.9 from PySide6.QtCore import SignalInstance try: diff --git a/sources/shiboken6/tests/samplebinding/typesystem_sample.xml b/sources/shiboken6/tests/samplebinding/typesystem_sample.xml index c49f5810b..799d04cf5 100644 --- a/sources/shiboken6/tests/samplebinding/typesystem_sample.xml +++ b/sources/shiboken6/tests/samplebinding/typesystem_sample.xml @@ -1385,7 +1385,7 @@ } </template> <modify-function signature="getMargins(int*,int*,int*,int*)const"> - <modify-argument index="0"> + <modify-argument index="return" pyi-type="Tuple[int, int, int, int]"> <replace-type modified-type="PyObject" /> </modify-argument> <modify-argument index="1"> |
