diff options
Diffstat (limited to 'sources/pyside2')
-rw-r--r-- | sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml | 2 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtQuick/CMakeLists.txt | 1 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtQuick/typesystem_quick.xml | 7 | ||||
-rw-r--r-- | sources/pyside2/libpyside/feature_select.cpp | 2 | ||||
-rw-r--r-- | sources/pyside2/libpyside/globalreceiverv2.cpp | 6 | ||||
-rw-r--r-- | sources/pyside2/libpyside/pysideslot.cpp | 13 | ||||
-rw-r--r-- | sources/pyside2/pyside_version.py | 2 | ||||
-rw-r--r-- | sources/pyside2/tests/QtWidgets/signature_test.py | 5 | ||||
-rw-r--r-- | sources/pyside2/tests/registry/scrape_testresults.py | 16 |
9 files changed, 34 insertions, 20 deletions
diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml index e66ee48ce..617d64355 100644 --- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml +++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml @@ -1824,7 +1824,7 @@ <define-ownership class="target" owner="target"/> </modify-argument> </modify-function> - <modify-function signature="print(QPagedPaintDevice*)const" rename="print_"/> + <modify-function signature="print(QPagedPaintDevice*)const" allow-thread="yes" rename="print_"/> </object-type> <object-type name="QTextDocumentWriter" since="4.5"/> <object-type name="QTextTable"> diff --git a/sources/pyside2/PySide2/QtQuick/CMakeLists.txt b/sources/pyside2/PySide2/QtQuick/CMakeLists.txt index 0f453c90e..a500f3bcd 100644 --- a/sources/pyside2/PySide2/QtQuick/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtQuick/CMakeLists.txt @@ -40,6 +40,7 @@ ${QtQuick_GEN_DIR}/qsgopacitynode_wrapper.cpp #${QtQuick_GEN_DIR}/qsgopaquetexturematerial_wrapper.cpp #${QtQuick_GEN_DIR}/qsgsimplematerial_wrapper.cpp #${QtQuick_GEN_DIR}/qsgsimplematerialshader_wrapper.cpp +${QtQuick_GEN_DIR}/qsgrendererinterface_wrapper.cpp ${QtQuick_GEN_DIR}/qsgsimplerectnode_wrapper.cpp ${QtQuick_GEN_DIR}/qsgsimpletexturenode_wrapper.cpp ${QtQuick_GEN_DIR}/qsgtexture_wrapper.cpp diff --git a/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml b/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml index 223eff773..4f6d9086c 100644 --- a/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml +++ b/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml @@ -150,6 +150,13 @@ <object-type name="QSGOpacityNode"/> <!-- <object-type name="QSGOpaqueTextureMaterial"/> --> <object-type name="QSGSimpleRectNode"/> + <object-type name="QSGRendererInterface"> + <enum-type name="GraphicsApi"/> + <enum-type name="Resource"/> + <enum-type name="ShaderType"/> + <enum-type name="ShaderCompilationType" flags="ShaderCompilationTypes"/> + <enum-type name="ShaderSourceType" flags="ShaderSourceTypes"/> + </object-type> <object-type name="QSGSimpleTextureNode"> <enum-type name="TextureCoordinatesTransformFlag" flags="TextureCoordinatesTransformMode"/> </object-type> diff --git a/sources/pyside2/libpyside/feature_select.cpp b/sources/pyside2/libpyside/feature_select.cpp index 7604f69aa..3011b3584 100644 --- a/sources/pyside2/libpyside/feature_select.cpp +++ b/sources/pyside2/libpyside/feature_select.cpp @@ -408,6 +408,8 @@ static inline PyObject *SelectFeatureSet(PyTypeObject *type) if (!SelectFeatureSetSubtype(sub_type, select_id)) break; } + // PYSIDE-1436: Clear all caches for the type and subtypes. + PyType_Modified(type); } return type->tp_dict; } diff --git a/sources/pyside2/libpyside/globalreceiverv2.cpp b/sources/pyside2/libpyside/globalreceiverv2.cpp index b16a923dd..88bba9338 100644 --- a/sources/pyside2/libpyside/globalreceiverv2.cpp +++ b/sources/pyside2/libpyside/globalreceiverv2.cpp @@ -291,8 +291,10 @@ void GlobalReceiverV2::notify() #endif Py_BEGIN_ALLOW_THREADS for (const QObject *o : objSet) { - QMetaObject::disconnect(o, DESTROY_SIGNAL_ID, this, DESTROY_SLOT_ID); - QMetaObject::connect(o, DESTROY_SIGNAL_ID, this, DESTROY_SLOT_ID); + if (o) { + QMetaObject::disconnect(o, DESTROY_SIGNAL_ID, this, DESTROY_SLOT_ID); + QMetaObject::connect(o, DESTROY_SIGNAL_ID, this, DESTROY_SLOT_ID); + } } Py_END_ALLOW_THREADS } diff --git a/sources/pyside2/libpyside/pysideslot.cpp b/sources/pyside2/libpyside/pysideslot.cpp index 7911b21de..660b93caf 100644 --- a/sources/pyside2/libpyside/pysideslot.cpp +++ b/sources/pyside2/libpyside/pysideslot.cpp @@ -134,11 +134,13 @@ int slotTpInit(PyObject *self, PyObject *args, PyObject *kw) PyObject *slotCall(PyObject *self, PyObject *args, PyObject * /* kw */) { static PyObject *pySlotName = nullptr; - PyObject *callback; - callback = PyTuple_GetItem(args, 0); + PyObject *callback = nullptr; + + if (!PyArg_UnpackTuple(args, "Slot.__call__", 1, 1, &callback)) + return nullptr; Py_INCREF(callback); - if (Py_TYPE(callback)->tp_call != nullptr) { + if (PyCallable_Check(callback)) { PySideSlot *data = reinterpret_cast<PySideSlot *>(self); if (!data->slotData) @@ -147,7 +149,7 @@ PyObject *slotCall(PyObject *self, PyObject *args, PyObject * /* kw */) if (data->slotData->name.isEmpty()) { // PYSIDE-198: Use PyObject_GetAttr instead of PepFunction_GetName to support Nuitka. AutoDecRef funcName(PyObject_GetAttr(callback, PyMagicName::name())); - data->slotData->name = String::toCString(funcName); + data->slotData->name = funcName.isNull() ? "<no name>" : String::toCString(funcName); } const QByteArray returnType = QMetaObject::normalizedType(data->slotData->resultType); const QByteArray signature = @@ -157,7 +159,7 @@ PyObject *slotCall(PyObject *self, PyObject *args, PyObject * /* kw */) pySlotName = String::fromCString(PYSIDE_SLOT_LIST_ATTR); PyObject *pySignature = String::fromCString(signature); - PyObject *signatureList = 0; + PyObject *signatureList = nullptr; if (PyObject_HasAttr(callback, pySlotName)) { signatureList = PyObject_GetAttr(callback, pySlotName); } else { @@ -172,7 +174,6 @@ PyObject *slotCall(PyObject *self, PyObject *args, PyObject * /* kw */) //clear data delete data->slotData; data->slotData = nullptr; - return callback; } return callback; } diff --git a/sources/pyside2/pyside_version.py b/sources/pyside2/pyside_version.py index 9ec9b0e70..ba6e714b1 100644 --- a/sources/pyside2/pyside_version.py +++ b/sources/pyside2/pyside_version.py @@ -39,7 +39,7 @@ major_version = "5" minor_version = "15" -patch_version = "7" +patch_version = "8" # For example: "a", "b", "rc" # (which means "alpha", "beta", "release candidate"). diff --git a/sources/pyside2/tests/QtWidgets/signature_test.py b/sources/pyside2/tests/QtWidgets/signature_test.py index 57fcf3874..cacb576d7 100644 --- a/sources/pyside2/tests/QtWidgets/signature_test.py +++ b/sources/pyside2/tests/QtWidgets/signature_test.py @@ -65,8 +65,9 @@ class PySideSignatureTest(unittest.TestCase): for thing in obj.__signature__: self.assertEqual(type(thing), inspect.Signature) sm = PySide2.QtWidgets.QApplication.__dict__["palette"] - self.assertFalse(callable(sm)) - self.assertEqual(sm.__func__, obj) + # PYSIDE-1436: staticmethod is a callable since Python 3.10 + # Instead of checking callable(sm), we check the type: + self.assertEqual(type(sm), staticmethod) self.assertTrue(hasattr(sm, "__signature__") and sm.__signature__ is not None) diff --git a/sources/pyside2/tests/registry/scrape_testresults.py b/sources/pyside2/tests/registry/scrape_testresults.py index c5c0e8689..56bb8058c 100644 --- a/sources/pyside2/tests/registry/scrape_testresults.py +++ b/sources/pyside2/tests/registry/scrape_testresults.py @@ -188,7 +188,7 @@ def write_data(name, text): lines.pop() text = "\n".join(lines) + "\n" modname = re.search(r"'(..*?)'", text).group(1) - fn = os.path.join(test_path, f"{ts}-{name}-{modname}.py") + fn = os.path.join(test_path, "{}-{}-{}.py".format(ts, name, modname)) if os.path.exists(fn): # do not change the file, we want to skip it return @@ -321,31 +321,31 @@ def get_test_results(starturl): minutes, seconds = divmod(remainder, 60) runtime_formatted = '%d:%02d:%06.3f' % (hours, minutes, seconds) - print(f"Run time: {runtime_formatted}s") + print("Run time: {}s".format(runtime_formatted)) if ok: found = eval_data() - print(f"Successful scan, {found} new files.") + print("Successful scan, {} new files.".format(found)) if found: print("Please check if a git push is necessary.") if __name__ == "__main__": parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, - usage=dedent(f"""\ - {os.path.basename(my_name)} [-h] scan + usage=dedent("""\ + {} [-h] scan - Scan the COIN testresults website for embedded exists_{{platf}}_{{version}}_ci.py files. + Scan the COIN testresults website for embedded exists_{{}}_{{}}_ci.py files. Warning: On the first call, this script may take almost 30 minutes to run. Subsequent calls are *much* faster due to caching. - {os.path.basename(my_name)} [-h] eval + {} [-h] eval Enforces evaluation when a scan did not complete yet. For more information, see the file sources/shiboken2/libshiboken/signature_doc.rst - """)) + """.format(os.path.basename(my_name), platf, version, os.path.basename(my_name))) subparsers = parser.add_subparsers(dest="command", metavar="", title="required argument") # create the parser for the "scan" command parser_scan = subparsers.add_parser("scan", help="run the scan") |