From a57a202a70801f766094c3ed11664b03c9a6a3e4 Mon Sep 17 00:00:00 2001 From: Cristian Maureira-Fredes Date: Thu, 11 Oct 2018 17:45:43 +0200 Subject: Move inject-code snippets to separate files When code must be modified or added to certain functions, we currently have two options: * Write a template and include it into the typesystem, * inject code directly at a certain place of the function entry. The problem with injecting raw code is that since it is an XML file, one need to escape protected symbols, like "<" and "&". Thanks to a couple of complementary commits, now we can place this code snippets on a separate file without triggering a whole module compiling process, since the typesystem itself will not be alterered. All the injected code from the typesystem was removed and placed into a single file per module inside a top-level directory called glue. Some small fixes were included mainly regarding styling of the code. Task-number: PYSIDE-834 Change-Id: I823e92d241a528d75d5940090008db9bf297f49e Reviewed-by: Qt CI Bot Reviewed-by: Friedemann Kleint --- .../pyside2/PySide2/QtCharts/typesystem_charts.xml | 10 +- .../PySide2/QtConcurrent/typesystem_concurrent.xml | 2 +- .../PySide2/QtCore/typesystem_core_common.xml | 1653 ++++++-------------- .../pyside2/PySide2/QtCore/typesystem_core_mac.xml | 8 +- .../pyside2/PySide2/QtCore/typesystem_core_win.xml | 10 +- .../pyside2/PySide2/QtCore/typesystem_core_x11.xml | 8 +- .../typesystem_datavisualization.xml | 26 +- .../PySide2/QtGui/typesystem_gui_common.xml | 982 ++++-------- .../pyside2/PySide2/QtGui/typesystem_gui_mac.xml | 4 +- sources/pyside2/PySide2/QtHelp/typesystem_help.xml | 4 +- .../QtMultimedia/typesystem_multimedia_common.xml | 51 +- .../typesystem_multimediawidgets.xml | 8 +- .../PySide2/QtNetwork/typesystem_network.xml | 93 +- .../pyside2/PySide2/QtOpenGL/typesystem_opengl.xml | 252 ++- .../QtPrintSupport/typesystem_printsupport.xml | 18 +- sources/pyside2/PySide2/QtQml/typesystem_qml.xml | 78 +- .../pyside2/PySide2/QtQuick/typesystem_quick.xml | 116 +- .../QtQuickWidgets/typesystem_quickwidgets.xml | 4 +- .../pyside2/PySide2/QtScript/typesystem_script.xml | 44 +- .../QtScriptTools/typesystem_scripttools.xml | 6 +- sources/pyside2/PySide2/QtSql/typesystem_sql.xml | 62 +- sources/pyside2/PySide2/QtSvg/typesystem_svg.xml | 4 +- sources/pyside2/PySide2/QtTest/typesystem_test.xml | 4 +- .../QtTextToSpeech/typesystem_texttospeech.xml | 2 +- .../PySide2/QtUiTools/typesystem_uitools.xml | 33 +- .../PySide2/QtWebChannel/typesystem_webchannel.xml | 4 +- .../typesystem_webenginewidgets.xml | 30 +- .../QtWebKitWidgets/typesystem_webkitwidgets.xml | 70 +- .../PySide2/QtWebSockets/typesystem_websockets.xml | 26 +- .../QtWidgets/typesystem_widgets_common.xml | 629 ++------ sources/pyside2/PySide2/QtXml/typesystem_xml.xml | 74 +- .../QtXmlPatterns/typesystem_xmlpatterns.xml | 91 +- sources/pyside2/PySide2/glue/qtcharts.cpp | 42 + sources/pyside2/PySide2/glue/qtcore.cpp | 1010 ++++++++++++ .../pyside2/PySide2/glue/qtdatavisualization.cpp | 42 + sources/pyside2/PySide2/glue/qtgui.cpp | 494 ++++++ sources/pyside2/PySide2/glue/qtmultimedia.cpp | 45 + sources/pyside2/PySide2/glue/qtnetwork.cpp | 80 + sources/pyside2/PySide2/glue/qtopengl.cpp | 74 + sources/pyside2/PySide2/glue/qtqml.cpp | 52 + sources/pyside2/PySide2/glue/qtquick.cpp | 42 + sources/pyside2/PySide2/glue/qtscript.cpp | 74 + sources/pyside2/PySide2/glue/qtuitools.cpp | 57 + sources/pyside2/PySide2/glue/qtwebkitwidgets.cpp | 77 + sources/pyside2/PySide2/glue/qtwidgets.cpp | 365 +++++ sources/pyside2/PySide2/glue/qtxml.cpp | 48 + sources/pyside2/PySide2/glue/qtxmlpatterns.cpp | 43 + 47 files changed, 3924 insertions(+), 3027 deletions(-) create mode 100644 sources/pyside2/PySide2/glue/qtcharts.cpp create mode 100644 sources/pyside2/PySide2/glue/qtcore.cpp create mode 100644 sources/pyside2/PySide2/glue/qtdatavisualization.cpp create mode 100644 sources/pyside2/PySide2/glue/qtgui.cpp create mode 100644 sources/pyside2/PySide2/glue/qtmultimedia.cpp create mode 100644 sources/pyside2/PySide2/glue/qtnetwork.cpp create mode 100644 sources/pyside2/PySide2/glue/qtopengl.cpp create mode 100644 sources/pyside2/PySide2/glue/qtqml.cpp create mode 100644 sources/pyside2/PySide2/glue/qtquick.cpp create mode 100644 sources/pyside2/PySide2/glue/qtscript.cpp create mode 100644 sources/pyside2/PySide2/glue/qtuitools.cpp create mode 100644 sources/pyside2/PySide2/glue/qtwebkitwidgets.cpp create mode 100644 sources/pyside2/PySide2/glue/qtwidgets.cpp create mode 100644 sources/pyside2/PySide2/glue/qtxml.cpp create mode 100644 sources/pyside2/PySide2/glue/qtxmlpatterns.cpp (limited to 'sources/pyside2') diff --git a/sources/pyside2/PySide2/QtCharts/typesystem_charts.xml b/sources/pyside2/PySide2/QtCharts/typesystem_charts.xml index ebcd09b18..14224751c 100644 --- a/sources/pyside2/PySide2/QtCharts/typesystem_charts.xml +++ b/sources/pyside2/PySide2/QtCharts/typesystem_charts.xml @@ -40,7 +40,7 @@ ****************************************************************************/ --> - + @@ -164,14 +164,10 @@ - - Shiboken::Object::releaseOwnership(%PYARG_1); - + - - Shiboken::Object::releaseOwnership(%PYARG_1); - + diff --git a/sources/pyside2/PySide2/QtConcurrent/typesystem_concurrent.xml b/sources/pyside2/PySide2/QtConcurrent/typesystem_concurrent.xml index bed947772..bdf4e6fa7 100644 --- a/sources/pyside2/PySide2/QtConcurrent/typesystem_concurrent.xml +++ b/sources/pyside2/PySide2/QtConcurrent/typesystem_concurrent.xml @@ -47,7 +47,7 @@ - + diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml index 3b5d9f520..7f4cb19b1 100644 --- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml +++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml @@ -42,46 +42,44 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - #include <pyside.h> - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -257,9 +257,9 @@ - + + to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m13(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.m23(), %CPPSELF.m31(), %CPPSELF.m32(), %CPPSELF.m33()"/> @@ -267,16 +267,16 @@ - + + to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m13(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.m23(), %CPPSELF.m31(), %CPPSELF.m32(), %CPPSELF.m33()"/> - + @@ -286,7 +286,7 @@ - + @@ -306,38 +306,14 @@ - - QTransform _result; - if (QTransform::quadToQuad(%1, %2, _result)) { - %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result); - } else { - Py_INCREF(Py_None); - %PYARG_0 = Py_None; - } - + - - QTransform _result; - if (QTransform::quadToSquare(%1, _result)) { - %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result); - } else { - Py_INCREF(Py_None); - %PYARG_0 = Py_None; - } - + - - QTransform _result; - if (QTransform::squareToQuad(%1, _result)) { - %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result); - } else { - Py_INCREF(Py_None); - %PYARG_0 = Py_None; - } - + @@ -346,21 +322,17 @@ - + - - uchar *buffer = reinterpret_cast<uchar*>(Shiboken::Buffer::getPointer(%PYARG_2)); - QBitmap %0 = QBitmap::fromData(%1, buffer, %3); - %PYARG_0 = %CONVERTTOPYTHON[QBitmap](%0); - + - - + + @@ -370,19 +342,12 @@ - + - + - - %BEGIN_ALLOW_THREADS - %RETURN_TYPE %0 = %CPPSELF->::%TYPE::%FUNCTION_NAME(&%1, %2); - %END_ALLOW_THREADS - %PYARG_0 = PyTuple_New(2); - PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0)); - PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](%1)); - + @@ -390,8 +355,8 @@ - - + + @@ -406,11 +371,11 @@ - - + + - + @@ -420,9 +385,9 @@ - + + to="(*%CPPSELF)[0], (*%CPPSELF)[1], (*%CPPSELF)[2], (*%CPPSELF)[3]"/> @@ -430,22 +395,15 @@ - - + + - - if (_i < 0 || _i >= %CPPSELF.count()) { - PyErr_SetString(PyExc_IndexError, "index out of bounds"); - return 0; - } - int item = (*%CPPSELF)[_i]; - return %CONVERTTOPYTHON[int](item); - + @@ -461,9 +419,7 @@ - - %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.data(), %CPPSELF.size()); - + @@ -502,13 +458,13 @@ - + - + @@ -516,36 +472,24 @@ - + - - const QTextDocument *doc = %CPPSELF.document(); - if (doc) { - Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc)); - Shiboken::Object::setParent(pyDocument, %PYARG_1); - } - + - - const QTextDocument *doc = %CPPSELF.document(); - if (doc) { - Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc)); - Shiboken::Object::setParent(pyDocument, %PYARG_0); - } - + - + @@ -555,7 +499,7 @@ - + @@ -566,17 +510,10 @@ - - PyObject *points = PyList_New(%CPPSELF.count()); - for (int i = 0, max = %CPPSELF.count(); i < max; ++i){ - int x, y; - %CPPSELF.point(i, &x, &y); - QPoint pt = QPoint(x, y); - PyList_SET_ITEM(points, i, %CONVERTTOPYTHON[QPoint](pt)); - } + - - + + @@ -586,18 +523,10 @@ - - // %FUNCTION_NAME() - *%CPPSELF << %1; - %PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF); - + - - // %FUNCTION_NAME() - *%CPPSELF << %1; - %PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF); - + @@ -658,16 +587,14 @@ - - %0 = new %TYPE(QPixmap::fromImage(%1)); - + - + - + @@ -699,7 +626,7 @@ - + @@ -715,12 +642,12 @@ - + - + @@ -749,9 +676,9 @@ - + + to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()"/> @@ -759,8 +686,8 @@ - - + + @@ -779,7 +706,7 @@ - + @@ -790,7 +717,7 @@ - + @@ -806,15 +733,15 @@ - - - + + + - + @@ -837,7 +764,7 @@ --> - + @@ -856,7 +783,7 @@ - + @@ -866,7 +793,7 @@ - + @@ -874,61 +801,52 @@ - + - + - + - + - + - + - - %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.byteCount()); - + - - // byteCount() is only available on Qt4.7, so we use bytesPerLine * height - %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.bytesPerLine() * %CPPSELF.height(), Shiboken::Buffer::ReadWrite); - + - - %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1), %CPPSELF.bytesPerLine()); - + - + - - %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1), %CPPSELF.bytesPerLine(), Shiboken::Buffer::ReadWrite); - + - + - + - - if (%1.type() == QVariant::Color) - %0 = new %TYPE(%1.value<QColor>()); - else - PyErr_SetString(PyExc_TypeError, "QVariant must be holding a QColor"); - + - + @@ -1150,13 +987,13 @@ - + - + @@ -1177,13 +1014,13 @@ - + - + @@ -1200,13 +1037,13 @@ - + - + @@ -1223,13 +1060,13 @@ - + - + @@ -1246,13 +1083,13 @@ - + - + @@ -1269,13 +1106,13 @@ - + - + @@ -1292,13 +1129,13 @@ - + - + @@ -1315,7 +1152,7 @@ - + @@ -1344,56 +1181,14 @@ - - int *array = nullptr; - bool errorOccurred = false; - - if (numArgs == 5) { - array = Shiboken::sequenceToIntArray(%PYARG_5, true); - if (PyErr_Occurred()) { - if (array) - delete []array; - errorOccurred = true; - } - } - - if (!errorOccurred) { - %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, array); - - if (array) - delete []array; - - %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval); - } - + - - int *array = nullptr; - bool errorOccurred = false; - - if (numArgs == 4) { - array = Shiboken::sequenceToIntArray(%PYARG_4, true); - if (PyErr_Occurred()) { - if (array) - delete []array; - errorOccurred = true; - } - } - - if (!errorOccurred) { - %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, array); - - if (array) - delete []array; - - %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval); - } - + @@ -1420,85 +1215,21 @@ - - int *array = nullptr; - bool errorOccurred = false; - - if (numArgs == 8) { - array = Shiboken::sequenceToIntArray(%PYARG_8, true); - if (PyErr_Occurred()) { - if (array) - delete []array; - errorOccurred = true; - } - } - - if (!errorOccurred) { - %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, %6, %7, array); - - if (array) - delete []array; - - %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval); - } - + - - int *array = nullptr; - bool errorOccurred = false; - - if (numArgs == 5) { - array = Shiboken::sequenceToIntArray(%PYARG_5, true); - if (PyErr_Occurred()) { - if (array) - delete []array; - errorOccurred = true; - } - } - - if (!errorOccurred) { - %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, array); - - if (array) - delete []array; - - %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval); - } - + - - int *array = nullptr; - bool errorOccurred = false; - - if (numArgs == 4) { - array = Shiboken::sequenceToIntArray(%PYARG_4, true); - if (PyErr_Occurred()) { - if (array) - delete []array; - errorOccurred = true; - } - } - - if (!errorOccurred) { - %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, array); - - if (array) - delete []array; - - %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval); - } - - + @@ -1508,20 +1239,20 @@ - + - - + + - + @@ -1534,15 +1265,15 @@ - + - + - - + + @@ -1564,7 +1295,7 @@ - + @@ -1577,19 +1308,11 @@ - - QPixmap p; - if (%CPPSELF.%FUNCTION_NAME(%1, &p)) { - %PYARG_0 = %CONVERTTOPYTHON[QPixmap](p); - } else { - %PYARG_0 = Py_None; - Py_INCREF(%PYARG_0); - } - + - + @@ -1641,27 +1364,13 @@ - - // Clear parent from the old child - QStandardItem *_i = %CPPSELF->child(%1, %2); - if (_i) { - PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i); - Shiboken::Object::setParent(0, _pyI); - } - + - - // Clear parent from the old child - QStandardItem *_i = %CPPSELF->child(%1); - if (_i) { - PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i); - Shiboken::Object::setParent(0, _pyI); - } - + @@ -1700,8 +1409,8 @@ - - + + @@ -1778,25 +1487,25 @@ - + - + - + - - - + + + @@ -1812,7 +1521,7 @@ - + @@ -1827,16 +1536,13 @@ - + - - bool ret = !(&%CPPSELF == %1); - %PYARG_0 = %CONVERTTOPYTHON[bool](ret); - + @@ -1860,13 +1566,13 @@ - + - + @@ -1874,7 +1580,7 @@ - + @@ -1884,7 +1590,7 @@ - + @@ -1903,7 +1609,7 @@ - + @@ -1964,170 +1670,135 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - - // Clear parent from the old child - QStandardItem *_i = %CPPSELF->item(%1, %2); - if (_i) { - PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i); - Shiboken::Object::setParent(0, _pyI); - } - + - + - - // Clear parent from the old child - QStandardItem *_i = %CPPSELF->item(%1); - if (_i) { - PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i); - Shiboken::Object::setParent(0, _pyI); - } - + - + - + - - // Clear parent from the old child - QStandardItem *_i = %CPPSELF->verticalHeaderItem(%1); - if (_i) { - PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i); - Shiboken::Object::setParent(0, _pyI); - } - + - + - + - + - + - + - + - + - - Shiboken::BindingManager &bm = Shiboken::BindingManager::instance(); - SbkObject *pyRoot = bm.retrieveWrapper(%CPPSELF.invisibleRootItem()); - if (pyRoot) { - Shiboken::Object::destroy(pyRoot, %CPPSELF.invisibleRootItem()); - } - - for (int r=0, r_max = %CPPSELF.rowCount(); r < r_max; r++) { - QList<QStandardItem *> ri = %CPPSELF.takeRow(0); - - PyObject *pyResult = %CONVERTTOPYTHON[QList<QStandardItem * >](ri); - Shiboken::Object::setParent(Py_None, pyResult); - Py_XDECREF(pyResult); - } - + @@ -2135,7 +1806,7 @@ - + @@ -2149,14 +1820,7 @@ - - %BEGIN_ALLOW_THREADS - %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2); - %END_ALLOW_THREADS - %PYARG_0 = PyTuple_New(2); - PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_)); - PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](%1)); - + @@ -2203,9 +1867,9 @@ - + - + @@ -2252,64 +1916,56 @@ %END_ALLOW_THREADS - + - + - + - + - - - - - - + + + + + + - + - + - + - + - + - - %BEGIN_ALLOW_THREADS - %CPPSELF.%FUNCTION_NAME(%1.data(), %1.size(), %2); - %END_ALLOW_THREADS - + - + - - %BEGIN_ALLOW_THREADS - %CPPSELF.%FUNCTION_NAME(%1.data(), %1.size(), %2); - %END_ALLOW_THREADS - + - + - + - + - + @@ -2389,8 +2045,8 @@ - - + + @@ -2398,22 +2054,22 @@ - - + + - + - + @@ -2427,8 +2083,8 @@ - - + + @@ -2436,22 +2092,22 @@ - - + + - + - + @@ -2465,8 +2121,8 @@ - - + + @@ -2474,22 +2130,22 @@ - - + + - + - + @@ -2503,8 +2159,8 @@ - - + + @@ -2512,22 +2168,22 @@ - - + + - + - + @@ -2541,8 +2197,8 @@ - - + + @@ -2550,22 +2206,22 @@ - - + + - + - + @@ -2579,8 +2235,8 @@ - - + + @@ -2588,22 +2244,22 @@ - - + + - + - + @@ -2616,8 +2272,8 @@ - - + + @@ -2625,22 +2281,22 @@ - - + + - + - + @@ -2654,8 +2310,8 @@ - - + + @@ -2663,22 +2319,22 @@ - - + + - + - + @@ -2710,8 +2366,8 @@ - - + + @@ -2719,8 +2375,8 @@ - - + + @@ -2730,27 +2386,14 @@ - + - - if (PySequence_Size(%PYARG_1) == 16) { - float values[16]; - for (int i=0; i < 16; i++) { - PyObject *pv = PySequence_Fast_GET_ITEM(%PYARG_1, i); - values[i] = PyFloat_AsDouble(pv); - } - - %0 = new %TYPE(values[0], values[1], values[2], values[3], - values[4], values[5], values[6], values[7], - values[8], values[9], values[10], values[11], - values[12], values[13], values[14], values[15]); - } - + - + @@ -2761,15 +2404,7 @@ - - float values[16]; - %CPPSELF.%FUNCTION_NAME(values); - %PYARG_0 = PyTuple_New(16); - for (int i = 0; i < 16; i++) { - PyObject *v = PyFloat_FromDouble(values[i]); - PyTuple_SET_ITEM(%PYARG_0, i, v); - } - + @@ -2791,21 +2426,7 @@ - - if (PySequence_Check(_key)) { - Shiboken::AutoDecRef key(PySequence_Fast(_key, "Invalid matrix index.")); - if (PySequence_Fast_GET_SIZE(key.object()) == 2) { - PyObject *posx = PySequence_Fast_GET_ITEM(key.object(), 0); - PyObject *posy = PySequence_Fast_GET_ITEM(key.object(), 1); - Py_ssize_t x = PyInt_AsSsize_t(posx); - Py_ssize_t y = PyInt_AsSsize_t(posy); - float ret = (*%CPPSELF)(x,y); - return %CONVERTTOPYTHON[float](ret); - } - } - PyErr_SetString(PyExc_IndexError, "Invalid matrix index."); - return 0; - + @@ -2815,8 +2436,8 @@ - - + + @@ -2824,16 +2445,16 @@ - - + + - - - + + + @@ -2843,16 +2464,16 @@ - - + + - - + + @@ -2860,8 +2481,8 @@ - - + + @@ -2869,8 +2490,8 @@ - - + + @@ -2883,8 +2504,8 @@ - - + + @@ -2892,8 +2513,8 @@ - - + + @@ -2901,8 +2522,8 @@ - - + + @@ -2915,8 +2536,8 @@ - - + + @@ -2924,8 +2545,8 @@ - - + + @@ -2933,8 +2554,8 @@ - - + + @@ -2960,7 +2581,7 @@ - + @@ -2986,7 +2607,7 @@ - + @@ -3016,32 +2637,25 @@ - + - - QGuiApplicationConstructor(%PYSELF, args, &%0); - + - - PyObject *empty = PyTuple_New(2); - if (!PyTuple_SetItem(empty, 0, PyList_New(0))) { - QGuiApplicationConstructor(%PYSELF, empty, &%0); - } - + - + - - - - + + + + - + @@ -3053,7 +2667,7 @@ - + @@ -3271,7 +2885,7 @@ - + @@ -3332,7 +2946,7 @@ - + @@ -3371,7 +2985,7 @@ --> - + @@ -3470,7 +3084,7 @@ - + diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_mac.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_mac.xml index 27fb9387f..4d24d5703 100644 --- a/sources/pyside2/PySide2/QtGui/typesystem_gui_mac.xml +++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_mac.xml @@ -45,6 +45,6 @@ - - + + diff --git a/sources/pyside2/PySide2/QtHelp/typesystem_help.xml b/sources/pyside2/PySide2/QtHelp/typesystem_help.xml index 080fe4240..287d6374e 100644 --- a/sources/pyside2/PySide2/QtHelp/typesystem_help.xml +++ b/sources/pyside2/PySide2/QtHelp/typesystem_help.xml @@ -41,7 +41,7 @@ --> - + @@ -52,7 +52,7 @@ - + diff --git a/sources/pyside2/PySide2/QtMultimedia/typesystem_multimedia_common.xml b/sources/pyside2/PySide2/QtMultimedia/typesystem_multimedia_common.xml index 6fe90ccb9..bb8a30234 100644 --- a/sources/pyside2/PySide2/QtMultimedia/typesystem_multimedia_common.xml +++ b/sources/pyside2/PySide2/QtMultimedia/typesystem_multimedia_common.xml @@ -40,9 +40,9 @@ ****************************************************************************/ --> - - - + + + @@ -177,25 +177,15 @@ - + - - %BEGIN_ALLOW_THREADS - QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1); - %CPPSELF.%FUNCTION_NAME(reinterpret_cast< %ARG1_TYPE >(upcastedArg)); - %END_ALLOW_THREADS - + - + - - %BEGIN_ALLOW_THREADS - QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1); - %CPPSELF.%FUNCTION_NAME(reinterpret_cast< %ARG1_TYPE >(upcastedArg)); - %END_ALLOW_THREADS - + @@ -282,36 +272,21 @@ - + - - %BEGIN_ALLOW_THREADS - QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1); - %CPPSELF.%FUNCTION_NAME(reinterpret_cast< %ARG1_TYPE >(upcastedArg)); - %END_ALLOW_THREADS - + - + - - %BEGIN_ALLOW_THREADS - QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1); - %CPPSELF.%FUNCTION_NAME(reinterpret_cast< %ARG1_TYPE >(upcastedArg)); - %END_ALLOW_THREADS - + - + - - %BEGIN_ALLOW_THREADS - QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1); - %CPPSELF.%FUNCTION_NAME(reinterpret_cast< %ARG1_TYPE >(upcastedArg)); - %END_ALLOW_THREADS - + diff --git a/sources/pyside2/PySide2/QtMultimediaWidgets/typesystem_multimediawidgets.xml b/sources/pyside2/PySide2/QtMultimediaWidgets/typesystem_multimediawidgets.xml index 16a42d2e3..550ae17eb 100644 --- a/sources/pyside2/PySide2/QtMultimediaWidgets/typesystem_multimediawidgets.xml +++ b/sources/pyside2/PySide2/QtMultimediaWidgets/typesystem_multimediawidgets.xml @@ -40,10 +40,10 @@ ****************************************************************************/ --> - - - - + + + + diff --git a/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml b/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml index d277b3228..3ffd9077e 100644 --- a/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml +++ b/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml @@ -55,7 +55,7 @@ - + @@ -65,18 +65,18 @@ - + - + - - - - - + + + + + @@ -135,19 +135,7 @@ - - Shiboken::AutoArrayPointer<char> data(%ARGUMENT_NAMES); - QHostAddress ha; - quint16 port; - %BEGIN_ALLOW_THREADS - %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(data, %ARGUMENT_NAMES, &ha, &port); - %END_ALLOW_THREADS - QByteArray ba(data, retval); - %PYARG_0 = PyTuple_New(3); - PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[QByteArray](ba)); - PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QHostAddress](ha)); - PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[quint16](port)); - + @@ -156,7 +144,7 @@ - + @@ -193,7 +181,7 @@ - + @@ -210,11 +198,11 @@ - - + + - - + + @@ -232,55 +220,28 @@ - + - + - + - - return 16; - + - - if (_i >= 16) { - PyErr_SetString(PyExc_IndexError, "index out of bounds"); - return 0; - } - if (_i < 0) - _i = 16 - qAbs(_i); - - uint item = %CPPSELF.c[_i]; - return %CONVERTTOPYTHON[uint](item); - - - - - return 16; - + - - if (_i >= 16) { - PyErr_SetString(PyExc_IndexError, "index out of bounds"); - return -1; - } - if (_i < 0) - _i = 16 - qAbs(_i); - quint8 item = %CONVERTTOCPP[quint8](_value); - %CPPSELF.c[_i] = item; - return 0; - + - + @@ -297,7 +258,7 @@ - + @@ -308,7 +269,7 @@ - + @@ -328,7 +289,7 @@ - + @@ -347,8 +308,8 @@ - - + + diff --git a/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml b/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml index c332eea0d..59019faa1 100644 --- a/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml +++ b/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml @@ -40,7 +40,7 @@ ****************************************************************************/ --> - + @@ -88,7 +88,7 @@ - + @@ -99,7 +99,7 @@ - + @@ -124,7 +124,7 @@ - + @@ -158,12 +158,12 @@ - + - - + + @@ -171,12 +171,12 @@ - + - - + + @@ -184,12 +184,12 @@ - + - - + + @@ -197,12 +197,12 @@ - + - - + + @@ -210,12 +210,12 @@ - + - - + + @@ -223,12 +223,12 @@ - + - - + + @@ -237,15 +237,15 @@ - + - - + + @@ -253,15 +253,15 @@ - + - - + + @@ -269,15 +269,15 @@ - + - - + + @@ -285,15 +285,15 @@ - + - - + + @@ -301,15 +301,15 @@ - + - - + + @@ -317,15 +317,15 @@ - + - - + + @@ -333,15 +333,15 @@ - + - - + + @@ -349,15 +349,15 @@ - + - - + + @@ -365,15 +365,15 @@ - + - - + + @@ -381,15 +381,15 @@ - + - - + + @@ -397,15 +397,15 @@ - + - - + + @@ -413,15 +413,15 @@ - + - - + + @@ -429,15 +429,15 @@ - + - - + + @@ -445,15 +445,15 @@ - + - - + + @@ -461,15 +461,15 @@ - + - - + + @@ -477,15 +477,15 @@ - + - - + + @@ -493,15 +493,15 @@ - + - - + + @@ -509,15 +509,15 @@ - + - - + + @@ -525,15 +525,15 @@ - + - - + + @@ -541,15 +541,15 @@ - + - - + + @@ -557,15 +557,15 @@ - + - - + + @@ -573,15 +573,15 @@ - + - - + + @@ -589,15 +589,15 @@ - + - - + + @@ -605,15 +605,15 @@ - + - - + + @@ -621,15 +621,15 @@ - + - - + + @@ -637,15 +637,15 @@ - + - - + + @@ -653,15 +653,15 @@ - + - - + + @@ -669,23 +669,23 @@ - + - - + + - - + + @@ -701,25 +701,10 @@ - - int size = (%2 < 0) ? %1.size() : %2; - %CPPSELF.allocate((const void*) %1.data(), size); - + - - Py_ssize_t dataSize = %CPPSELF.size(); - void* data = %CPPSELF.map(%1); - - if (!data) { - Py_INCREF(Py_None); - %PYARG_0 = Py_None; - } else if (%1 == QGLBuffer::ReadOnly) { - %PYARG_0 = Shiboken::Buffer::newObject(data, dataSize, Shiboken::Buffer::ReadOnly); - } else { - %PYARG_0 = Shiboken::Buffer::newObject(data, dataSize, Shiboken::Buffer::ReadWrite); - } - + @@ -728,17 +713,7 @@ - - char *data = new char[%3]; - bool result = %CPPSELF.read(%1, data, %3); - QByteArray ret; - if (result) - ret.append((const char*)data, %3); - %PYARG_0 = PyTuple_New(2); - PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[bool](result)); - PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QByteArray](ret)); - delete[] data; - + @@ -747,10 +722,7 @@ - - int size = (%3 < 0) ? %2.size() : %3; - %CPPSELF.write(%1, (const void*) %2.data(), size); - + diff --git a/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport.xml b/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport.xml index b6111a0e6..f85aadc79 100644 --- a/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport.xml +++ b/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport.xml @@ -40,24 +40,24 @@ ****************************************************************************/ --> - + - - + + - + - + - + @@ -74,7 +74,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -111,7 +111,7 @@ - + diff --git a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml index f5e3d36fc..b0bdfaa27 100644 --- a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml +++ b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml @@ -45,7 +45,7 @@ - + - + - + - - + + - - + + - + volatile bool * %out = &((reinterpret_cast<QtQml_VolatileBoolObject *>(%PYARG_1))->flag); @@ -175,22 +167,22 @@ allow instantiating or deriving from the class though, given that a separate custom ListProperty type is provided by the module. Plus meta type registration would have to be taken into account for the QML parts. - --> - - + --> + + - - + + - - + + - + @@ -201,7 +193,7 @@ - + diff --git a/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml b/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml index dde90166f..2dc90b9e0 100644 --- a/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml +++ b/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml @@ -45,130 +45,128 @@ - + - - PySide::initQuickSupport(module); - + - + - - + + - - - + + + - + - - - - + + + + - + - + - + - - + + - + - + - - + + - - - + + + - + - - - + + + - + - + - + - - - - - - + + + + + + - + - - - + + + - - - + + + - + - - + + - - - - + + + + diff --git a/sources/pyside2/PySide2/QtQuickWidgets/typesystem_quickwidgets.xml b/sources/pyside2/PySide2/QtQuickWidgets/typesystem_quickwidgets.xml index 03230187e..e44ef8e6d 100644 --- a/sources/pyside2/PySide2/QtQuickWidgets/typesystem_quickwidgets.xml +++ b/sources/pyside2/PySide2/QtQuickWidgets/typesystem_quickwidgets.xml @@ -48,7 +48,7 @@ - - + + diff --git a/sources/pyside2/PySide2/QtScript/typesystem_script.xml b/sources/pyside2/PySide2/QtScript/typesystem_script.xml index d2d3e3182..f87e4cfdf 100644 --- a/sources/pyside2/PySide2/QtScript/typesystem_script.xml +++ b/sources/pyside2/PySide2/QtScript/typesystem_script.xml @@ -40,7 +40,7 @@ ****************************************************************************/ --> - + @@ -62,7 +62,7 @@ - + @@ -82,53 +82,23 @@ - - if (%CPPSELF.isVariant() || %CPPSELF.isString()) { - QString format = QString().sprintf("%s(\"%s\")", - Py_TYPE(%PYSELF)->tp_name, - qPrintable(%CPPSELF.toString())); - %PYARG_0 = Shiboken::String::fromCString(qPrintable(format)); - } else { - %PYARG_0 = Shiboken::String::fromCString(Py_TYPE(%PYSELF)->tp_name); - } - + - - Shiboken::AutoDecRef key(PyObject_Str(_key)); - QVariant res = %CPPSELF.property(Shiboken::String::toCString(key.object())).toVariant(); - if (res.isValid()) { - return %CONVERTTOPYTHON[QVariant](res); - } else { - PyObject* errorType = PyInt_Check(_key) ? PyExc_IndexError : PyExc_KeyError; - PyErr_SetString(errorType, "Key not found."); - return 0; - } - + - + - + - - if (%CPPSELF.hasNext()) { - %CPPSELF.next(); - QString name = %CPPSELF.name(); - QVariant value = %CPPSELF.value().toVariant(); - %PYARG_0 = PyTuple_New(2); - PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[QString](name)); - PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QVariant](value)); - } else { - PyErr_SetNone(PyExc_StopIteration); - } - + diff --git a/sources/pyside2/PySide2/QtScriptTools/typesystem_scripttools.xml b/sources/pyside2/PySide2/QtScriptTools/typesystem_scripttools.xml index 81a4048b5..770a2f25f 100644 --- a/sources/pyside2/PySide2/QtScriptTools/typesystem_scripttools.xml +++ b/sources/pyside2/PySide2/QtScriptTools/typesystem_scripttools.xml @@ -40,9 +40,9 @@ ****************************************************************************/ --> - - - + + + diff --git a/sources/pyside2/PySide2/QtSql/typesystem_sql.xml b/sources/pyside2/PySide2/QtSql/typesystem_sql.xml index 3eab73307..c8a56a213 100644 --- a/sources/pyside2/PySide2/QtSql/typesystem_sql.xml +++ b/sources/pyside2/PySide2/QtSql/typesystem_sql.xml @@ -65,12 +65,12 @@ - - - - - - + + + + + + @@ -86,15 +86,15 @@ - - - - - - - - - + + + + + + + + + @@ -107,7 +107,7 @@ - + @@ -118,10 +118,10 @@ - + - + @@ -131,10 +131,10 @@ - - - - + + + + @@ -150,7 +150,7 @@ - + @@ -167,15 +167,15 @@ - + - - - - - - - + + + + + + + diff --git a/sources/pyside2/PySide2/QtSvg/typesystem_svg.xml b/sources/pyside2/PySide2/QtSvg/typesystem_svg.xml index 5c4fcb7a8..6523ce541 100644 --- a/sources/pyside2/PySide2/QtSvg/typesystem_svg.xml +++ b/sources/pyside2/PySide2/QtSvg/typesystem_svg.xml @@ -42,8 +42,8 @@ - - + + diff --git a/sources/pyside2/PySide2/QtTest/typesystem_test.xml b/sources/pyside2/PySide2/QtTest/typesystem_test.xml index 86c12f888..ea231f2ee 100644 --- a/sources/pyside2/PySide2/QtTest/typesystem_test.xml +++ b/sources/pyside2/PySide2/QtTest/typesystem_test.xml @@ -97,8 +97,8 @@ a simply missing type name in the argument list leads to this message. - - + + ^^^ this is now moved into QtGui --> diff --git a/sources/pyside2/PySide2/QtTextToSpeech/typesystem_texttospeech.xml b/sources/pyside2/PySide2/QtTextToSpeech/typesystem_texttospeech.xml index 9e553ec5b..fee04f444 100644 --- a/sources/pyside2/PySide2/QtTextToSpeech/typesystem_texttospeech.xml +++ b/sources/pyside2/PySide2/QtTextToSpeech/typesystem_texttospeech.xml @@ -40,7 +40,7 @@ ****************************************************************************/ --> - + diff --git a/sources/pyside2/PySide2/QtUiTools/typesystem_uitools.xml b/sources/pyside2/PySide2/QtUiTools/typesystem_uitools.xml index 4fded3479..648a38cd5 100644 --- a/sources/pyside2/PySide2/QtUiTools/typesystem_uitools.xml +++ b/sources/pyside2/PySide2/QtUiTools/typesystem_uitools.xml @@ -41,20 +41,18 @@ --> - - + + - - Q_IMPORT_PLUGIN(PyCustomWidgets); - + - + Registers a Python created custom widget to QUiLoader, so it can be recognized when @@ -87,10 +85,7 @@ # ... - - registerCustomWidget(%PYARG_1); - %CPPSELF.addPluginPath(""); // force reload widgets - + @@ -119,31 +114,25 @@ - - + + - - // Avoid calling the original function: %CPPSELF.%FUNCTION_NAME() - %PYARG_0 = QUiLoadedLoadUiFromDevice(%CPPSELF, %1, %2); - + - - + + - - // Avoid calling the original function: %CPPSELF.%FUNCTION_NAME() - %PYARG_0 = QUiLoaderLoadUiFromFileName(%CPPSELF, %1, %2); - + diff --git a/sources/pyside2/PySide2/QtWebChannel/typesystem_webchannel.xml b/sources/pyside2/PySide2/QtWebChannel/typesystem_webchannel.xml index 874924d25..a1cfb91f2 100644 --- a/sources/pyside2/PySide2/QtWebChannel/typesystem_webchannel.xml +++ b/sources/pyside2/PySide2/QtWebChannel/typesystem_webchannel.xml @@ -42,7 +42,7 @@ - + @@ -50,6 +50,6 @@ + --> diff --git a/sources/pyside2/PySide2/QtWebEngineWidgets/typesystem_webenginewidgets.xml b/sources/pyside2/PySide2/QtWebEngineWidgets/typesystem_webenginewidgets.xml index 6e7418426..b8546d824 100644 --- a/sources/pyside2/PySide2/QtWebEngineWidgets/typesystem_webenginewidgets.xml +++ b/sources/pyside2/PySide2/QtWebEngineWidgets/typesystem_webenginewidgets.xml @@ -54,35 +54,35 @@ - + + --> - + - + - - - - - - + + + + + + - - + + - - + + @@ -94,7 +94,7 @@ - + diff --git a/sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml b/sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml index 74a96250a..fa54703c3 100644 --- a/sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml +++ b/sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml @@ -66,13 +66,13 @@ - + - + @@ -87,13 +87,9 @@ - - SbkObject* _pyReturn = reinterpret_cast<SbkObject*>(%PYARG_0); - if (!Shiboken::Object::hasParentInfo(_pyReturn)) - Shiboken::Object::setParent(%PYSELF, %PYARG_0); - + - + @@ -102,34 +98,25 @@ - - return %CPPSELF.count(); - + - - if (_i < 0 || _i >= %CPPSELF.count()) { - PyErr_SetString(PyExc_IndexError, "index out of bounds"); - return 0; - } - QWebElement element = %CPPSELF.at(_i); - return %CONVERTTOPYTHON[QWebElement](element); - + - + - + - + @@ -149,18 +136,18 @@ - - + + - - - - - - - + + + + + + +