aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-10-11 17:45:43 +0200
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-11-22 17:00:11 +0000
commita57a202a70801f766094c3ed11664b03c9a6a3e4 (patch)
tree73c2c1f4fc902ccbc10b73811bbf299a2c555728 /sources
parentf93a7369657814206bfbce49817c8fbd9a1bfcba (diff)
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 <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources')
-rw-r--r--sources/pyside2/PySide2/QtCharts/typesystem_charts.xml10
-rw-r--r--sources/pyside2/PySide2/QtConcurrent/typesystem_concurrent.xml2
-rw-r--r--sources/pyside2/PySide2/QtCore/typesystem_core_common.xml1653
-rw-r--r--sources/pyside2/PySide2/QtCore/typesystem_core_mac.xml8
-rw-r--r--sources/pyside2/PySide2/QtCore/typesystem_core_win.xml10
-rw-r--r--sources/pyside2/PySide2/QtCore/typesystem_core_x11.xml8
-rw-r--r--sources/pyside2/PySide2/QtDataVisualization/typesystem_datavisualization.xml26
-rw-r--r--sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml982
-rw-r--r--sources/pyside2/PySide2/QtGui/typesystem_gui_mac.xml4
-rw-r--r--sources/pyside2/PySide2/QtHelp/typesystem_help.xml4
-rw-r--r--sources/pyside2/PySide2/QtMultimedia/typesystem_multimedia_common.xml51
-rw-r--r--sources/pyside2/PySide2/QtMultimediaWidgets/typesystem_multimediawidgets.xml8
-rw-r--r--sources/pyside2/PySide2/QtNetwork/typesystem_network.xml93
-rw-r--r--sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml252
-rw-r--r--sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport.xml18
-rw-r--r--sources/pyside2/PySide2/QtQml/typesystem_qml.xml78
-rw-r--r--sources/pyside2/PySide2/QtQuick/typesystem_quick.xml116
-rw-r--r--sources/pyside2/PySide2/QtQuickWidgets/typesystem_quickwidgets.xml4
-rw-r--r--sources/pyside2/PySide2/QtScript/typesystem_script.xml44
-rw-r--r--sources/pyside2/PySide2/QtScriptTools/typesystem_scripttools.xml6
-rw-r--r--sources/pyside2/PySide2/QtSql/typesystem_sql.xml62
-rw-r--r--sources/pyside2/PySide2/QtSvg/typesystem_svg.xml4
-rw-r--r--sources/pyside2/PySide2/QtTest/typesystem_test.xml4
-rw-r--r--sources/pyside2/PySide2/QtTextToSpeech/typesystem_texttospeech.xml2
-rw-r--r--sources/pyside2/PySide2/QtUiTools/typesystem_uitools.xml33
-rw-r--r--sources/pyside2/PySide2/QtWebChannel/typesystem_webchannel.xml4
-rw-r--r--sources/pyside2/PySide2/QtWebEngineWidgets/typesystem_webenginewidgets.xml30
-rw-r--r--sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml70
-rw-r--r--sources/pyside2/PySide2/QtWebSockets/typesystem_websockets.xml26
-rw-r--r--sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml629
-rw-r--r--sources/pyside2/PySide2/QtXml/typesystem_xml.xml74
-rw-r--r--sources/pyside2/PySide2/QtXmlPatterns/typesystem_xmlpatterns.xml91
-rw-r--r--sources/pyside2/PySide2/glue/qtcharts.cpp42
-rw-r--r--sources/pyside2/PySide2/glue/qtcore.cpp1010
-rw-r--r--sources/pyside2/PySide2/glue/qtdatavisualization.cpp42
-rw-r--r--sources/pyside2/PySide2/glue/qtgui.cpp494
-rw-r--r--sources/pyside2/PySide2/glue/qtmultimedia.cpp45
-rw-r--r--sources/pyside2/PySide2/glue/qtnetwork.cpp80
-rw-r--r--sources/pyside2/PySide2/glue/qtopengl.cpp74
-rw-r--r--sources/pyside2/PySide2/glue/qtqml.cpp52
-rw-r--r--sources/pyside2/PySide2/glue/qtquick.cpp42
-rw-r--r--sources/pyside2/PySide2/glue/qtscript.cpp74
-rw-r--r--sources/pyside2/PySide2/glue/qtuitools.cpp57
-rw-r--r--sources/pyside2/PySide2/glue/qtwebkitwidgets.cpp77
-rw-r--r--sources/pyside2/PySide2/glue/qtwidgets.cpp365
-rw-r--r--sources/pyside2/PySide2/glue/qtxml.cpp48
-rw-r--r--sources/pyside2/PySide2/glue/qtxmlpatterns.cpp43
47 files changed, 3924 insertions, 3027 deletions
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 @@
****************************************************************************/
-->
<typesystem package="PySide2.QtCharts">
- <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no" />
+ <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
<namespace-type name="QtCharts">
<object-type name="QAbstractAxis" since="5.7">
<enum-type name="AxisType"/>
@@ -164,14 +164,10 @@
</modify-argument>
</modify-function>
<modify-function signature="removeAxis(QtCharts::QAbstractAxis*)">
- <inject-code>
- Shiboken::Object::releaseOwnership(%PYARG_1);
- </inject-code>
+ <inject-code file="../glue/qtcharts.cpp" snippet="qchart-releaseownership"/>
</modify-function>
<modify-function signature="removeSeries(QtCharts::QAbstractSeries*)">
- <inject-code>
- Shiboken::Object::releaseOwnership(%PYARG_1);
- </inject-code>
+ <inject-code file="../glue/qtcharts.cpp" snippet="qchart-releaseownership"/>
</modify-function>
</object-type>
<object-type name="QChartView" since="5.7">
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 @@
<namespace-type name="QtConcurrent" target-type="class">
<rejection class="QtConcurrent" enum-name="enum_1"/>
<enum-type name="ReduceOption" flags="ReduceOptions"/>
- <enum-type name="ThreadFunctionResult" />
+ <enum-type name="ThreadFunctionResult"/>
<extra-includes>
<include file-name="qtconcurrentreducekernel.h" location="global"/>
<include file-name="qtconcurrentthreadengine.h" location="global"/>
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 @@
<typesystem package="PySide2.QtCore">
<load-typesystem name="typesystem_templates.xml" generate="no"/>
- <custom-type name="str" />
- <custom-type name="PyBytes" />
- <custom-type name="PyByteArray" />
- <custom-type name="PyCallable" />
- <custom-type name="PyObject" />
- <custom-type name="PySequence" />
- <custom-type name="PyTypeObject" />
- <custom-type name="PyUnicode" />
- <custom-type name="list of QAbstractAnimation" />
- <custom-type name="list of QAbstractState" />
-
- <function signature="qAcos(qreal)" />
- <function signature="qAsin(qreal)" since="4.6" />
- <function signature="qAtan(qreal)" since="4.6" />
- <function signature="qAtan2(qreal,qreal)" since="4.6" />
- <function signature="qChecksum(const char*,uint)" />
- <function signature="qExp(qreal)" since="4.6" />
- <function signature="qFabs(qreal)" since="4.6" />
+ <custom-type name="str"/>
+ <custom-type name="PyBytes"/>
+ <custom-type name="PyByteArray"/>
+ <custom-type name="PyCallable"/>
+ <custom-type name="PyObject"/>
+ <custom-type name="PySequence"/>
+ <custom-type name="PyTypeObject"/>
+ <custom-type name="PyUnicode"/>
+ <custom-type name="list of QAbstractAnimation"/>
+ <custom-type name="list of QAbstractState"/>
+
+ <function signature="qAcos(qreal)"/>
+ <function signature="qAsin(qreal)" since="4.6"/>
+ <function signature="qAtan(qreal)" since="4.6"/>
+ <function signature="qAtan2(qreal,qreal)" since="4.6"/>
+ <function signature="qChecksum(const char*,uint)"/>
+ <function signature="qExp(qreal)" since="4.6"/>
+ <function signature="qFabs(qreal)" since="4.6"/>
<function signature="qFastCos(qreal)" since="4.6"/>
- <function signature="qFastSin(qreal)" since="4.6" />
- <function signature="qFuzzyCompare(double,double)" />
- <function signature="qFuzzyIsNull(double)" since="4.6" />
- <function signature="qIsFinite(double)" />
- <function signature="qIsInf(double)" />
- <function signature="qIsNaN(double)" />
- <function signature="qIsNull(double)" />
- <!-- Qt5: gone <function signature="qRound(qreal)" /> -->
- <function signature="qTan(qreal)" since="4.6" />
- <function signature="qtTrId(const char*,int)" since="4.6" />
- <function signature="qVersion()" />
- <function signature="qrand()" />
- <function signature="qsrand(uint)" />
+ <function signature="qFastSin(qreal)" since="4.6"/>
+ <function signature="qFuzzyCompare(double,double)"/>
+ <function signature="qFuzzyIsNull(double)" since="4.6"/>
+ <function signature="qIsFinite(double)"/>
+ <function signature="qIsInf(double)"/>
+ <function signature="qIsNaN(double)"/>
+ <function signature="qIsNull(double)"/>
+ <!-- Qt5: gone <function signature="qRound(qreal)"/> -->
+ <function signature="qTan(qreal)" since="4.6"/>
+ <function signature="qtTrId(const char*,int)" since="4.6"/>
+ <function signature="qVersion()"/>
+ <function signature="qrand()"/>
+ <function signature="qsrand(uint)"/>
<function signature="qCompress(const uchar*,int,int)"/>
<function signature="qCompress(const QByteArray&amp;,int)"/>
<function signature="qUncompress(const uchar*,int)"/>
<function signature="qUncompress(const QByteArray&amp;)"/>
- <inject-code class="native" position="beginning">
- #include &lt;pyside.h&gt;
- </inject-code>
+ <inject-code class="native" position="beginning" file="../glue/qtcore.cpp" snippet="include-pyside"/>
<template name="use_stream_for_format_security">
// Uses the stream version for security reasons
@@ -91,26 +89,20 @@
<add-function signature="qDebug(const char*)">
<inject-code>
- <insert-template name="use_stream_for_format_security" />
+ <insert-template name="use_stream_for_format_security"/>
</inject-code>
</add-function>
<add-function signature="qCritical(const char*)">
<inject-code>
- <insert-template name="use_stream_for_format_security" />
+ <insert-template name="use_stream_for_format_security"/>
</inject-code>
</add-function>
<add-function signature="qFatal(const char*)">
- <inject-code>
- // qFatal doesn't have a stream version, so we do a
- // qWarning call followed by a qFatal() call using a
- // literal.
- qWarning() &lt;&lt; %1;
- qFatal("[A qFatal() call was made from Python code]");
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qfatal"/>
</add-function>
<add-function signature="qWarning(const char*)">
<inject-code>
- <insert-template name="use_stream_for_format_security" />
+ <insert-template name="use_stream_for_format_security"/>
</inject-code>
</add-function>
@@ -127,9 +119,9 @@
<rejection class="QChildEvent" field-name="c"/>
<rejection class="QTimerEvent" field-name="id"/>
<rejection class="QEvent" field-name="t"/>
- <rejection class="*" function-name="tr" />
- <rejection class="*" function-name="trUtf8" />
- <rejection class="*" function-name="qt_metacast" />
+ <rejection class="*" function-name="tr"/>
+ <rejection class="*" function-name="trUtf8"/>
+ <rejection class="*" function-name="qt_metacast"/>
<!-- From Qt4.6 -->
<rejection class="*" field-name="d_ptr"/>
<rejection class="*" field-name="staticQtMetaObject"/>
@@ -144,7 +136,7 @@
<rejection class="*" function-name="qReallocAligned"/>
<rejection class="*" function-name="qMallocAligned"/>
<rejection class="*" function-name="qFreeAligned"/>
- <rejection class="QMetaMethod" enum-name="Attributes" />
+ <rejection class="QMetaMethod" enum-name="Attributes"/>
<rejection class="*" argument-type="QByteArrayDataPtr"/>
<rejection class="*" argument-type="^qfloat16&amp;?$"/>
@@ -197,13 +189,13 @@
<primitive-type name="qint64"/>
<primitive-type name="unsigned long long"/>
<primitive-type name="long long"/>
- <primitive-type name="qlonglong" target-lang-api-name="PyLong" />
- <primitive-type name="qulonglong" target-lang-api-name="PyLong" />
+ <primitive-type name="qlonglong" target-lang-api-name="PyLong"/>
+ <primitive-type name="qulonglong" target-lang-api-name="PyLong"/>
<primitive-type name="short"/>
<primitive-type name="signed short"/>
<primitive-type name="signed short int"/>
- <primitive-type name="ushort" target-lang-api-name="PyInt" />
- <primitive-type name="unsigned short int" />
+ <primitive-type name="ushort" target-lang-api-name="PyInt"/>
+ <primitive-type name="unsigned short int"/>
<primitive-type name="unsigned short"/>
<primitive-type name="char"/>
<primitive-type name="signed char"/>
@@ -217,7 +209,7 @@
<primitive-type name="signed long"/>
<primitive-type name="signed long int"/>
<primitive-type name="long"/>
- <primitive-type name="unsigned long int" />
+ <primitive-type name="unsigned long int"/>
<primitive-type name="unsigned long">
<!-- FIXME APIExtractor or shiboken do not support multiple includes by primitive type -->
<include file-name="signalmanager.h" location="global"/>
@@ -274,16 +266,7 @@
</conversion-rule>
</primitive-type>
- <inject-code class="native" position="beginning">
- bool py2kStrCheck(PyObject *obj)
- {
- #ifdef IS_PY3K
- return false;
- #else
- return PyString_Check(obj);
- #endif
- }
- </inject-code>
+ <inject-code class="native" position="beginning" file="../glue/qtcore.cpp" snippet="pystring-check"/>
<primitive-type name="QString" target-lang-api-name="PyUnicode">
<include file-name="QString" location="global"/>
@@ -443,143 +426,7 @@
</target-to-native>
</conversion-rule>
</primitive-type>
- <inject-code class="native" position="beginning">
- static const char *QVariant_resolveMetaType(PyTypeObject *type, int *typeId)
- {
- if (PyObject_TypeCheck(type, SbkObjectType_TypeF())) {
- SbkObjectType* sbkType = (SbkObjectType*)type;
- const char* typeName = Shiboken::ObjectType::getOriginalName(sbkType);
- if (!typeName)
- return 0;
- bool valueType = '*' != typeName[qstrlen(typeName) - 1];
- // Do not convert user type of value
- if (valueType &amp;&amp; Shiboken::ObjectType::isUserType(type))
- return 0;
- int obTypeId = QMetaType::type(typeName);
- if (obTypeId) {
- *typeId = obTypeId;
- return typeName;
- }
- // Do not resolve types to value type
- if (valueType)
- return 0;
- // Find in base types. First check tp_bases, and only after check tp_base, because
- // tp_base does not always point to the first base class, but rather to the first
- // that has added any python fields or slots to its object layout.
- // See https://mail.python.org/pipermail/python-list/2009-January/520733.html
- if (type->tp_bases) {
- for (int i = 0; i &lt; PyTuple_GET_SIZE(type->tp_bases); ++i) {
- const char *derivedName = QVariant_resolveMetaType(reinterpret_cast&lt;PyTypeObject *&gt;(PyTuple_GET_ITEM(
- type->tp_bases, i)), typeId);
- if (derivedName)
- return derivedName;
- }
- }
- else if (type->tp_base) {
- return QVariant_resolveMetaType(type->tp_base, typeId);
- }
- }
- *typeId = 0;
- return 0;
- }
- static QVariant QVariant_convertToValueList(PyObject *list)
- {
- if (PySequence_Size(list) &lt; 0) {
- // clear the error if &lt; 0 which means no length at all
- PyErr_Clear();
- return QVariant();
- }
-
- Shiboken::AutoDecRef element(PySequence_GetItem(list, 0));
- int typeId;
- const char *typeName = QVariant_resolveMetaType(element.cast&lt;PyTypeObject*&gt;(), &amp;typeId);
- if (typeName) {
- QByteArray listTypeName("QList&lt;");
- listTypeName += typeName;
- listTypeName += '>';
- typeId = QMetaType::type(listTypeName);
- if (typeId &gt; 0) {
- Shiboken::Conversions::SpecificConverter converter(listTypeName);
- if (converter) {
- QVariant var(typeId, (void*)0);
- converter.toCpp(list, &amp;var);
- return var;
- }
- qWarning() &lt;&lt; "Type converter for :" &lt;&lt; listTypeName &lt;&lt; "not registered.";
- }
- }
- return QVariant();
- }
- static bool QVariant_isStringList(PyObject *list)
- {
- bool allString = true;
-
- if (PySequence_Check(list)) {
- if (PySequence_Size(list) &lt; 0) {
- // clear the error if &lt; 0 which means no length at all
- PyErr_Clear();
- return false;
- }
- Shiboken::AutoDecRef fast(PySequence_Fast(list, "Failed to convert QVariantList"));
- Py_ssize_t size = PySequence_Fast_GET_SIZE(fast.object());
- for (int i = 0; i &lt; size; ++i) {
- PyObject *item = PySequence_Fast_GET_ITEM(fast.object(), i);
- if (!%CHECKTYPE[QString](item)) {
- allString = false;
- break;
- }
- }
- } else {
- // If it is not a list or a derived list class
- // we assume that will not be a String list neither.
- allString = false;
- }
- return allString;
- }
- static QVariant QVariant_convertToVariantMap(PyObject *map)
- {
- Py_ssize_t pos = 0;
- Shiboken::AutoDecRef keys(PyDict_Keys(map));
- if (!QVariant_isStringList(keys))
- return QVariant();
- PyObject *key;
- PyObject *value;
- QMap&lt;QString,QVariant&gt; ret;
- while (PyDict_Next(map, &amp;pos, &amp;key, &amp;value)) {
- QString cppKey = %CONVERTTOCPP[QString](key);
- QVariant cppValue = %CONVERTTOCPP[QVariant](value);
- ret.insert(cppKey, cppValue);
- }
- return QVariant(ret);
- }
- static QVariant QVariant_convertToVariantList(PyObject *list)
- {
- if (QVariant_isStringList(list)) {
- QList&lt;QString &gt; lst = %CONVERTTOCPP[QList&lt;QString&gt;](list);
- return QVariant(QStringList(lst));
- }
- QVariant valueList = QVariant_convertToValueList(list);
- if (valueList.isValid())
- return valueList;
-
- if (PySequence_Size(list) &lt; 0) {
- // clear the error if &lt; 0 which means no length at all
- PyErr_Clear();
- return QVariant();
- }
-
- QList&lt;QVariant&gt; lst;
- Shiboken::AutoDecRef fast(PySequence_Fast(list, "Failed to convert QVariantList"));
- Py_ssize_t size = PySequence_Fast_GET_SIZE(fast.object());
- for (int i = 0; i &lt; size; ++i) {
- PyObject *pyItem = PySequence_Fast_GET_ITEM(fast.object(), i);
- QVariant item = %CONVERTTOCPP[QVariant](pyItem);
- lst.append(item);
- }
- return QVariant(lst);
- }
- </inject-code>
-
+ <inject-code class="native" position="beginning" file="../glue/qtcore.cpp" snippet="qvariant-conversion"/>
<primitive-type name="QVariant::Type" default-constructor="QVariant::Invalid">
<conversion-rule>
<native-to-target>
@@ -624,44 +471,20 @@
</primitive-type>
<primitive-type name="QVariantMap" target-lang-api-name="PyDict"/>
- <inject-code class="target" position="end">
- Shiboken::Conversions::registerConverterName(SbkPySide2_QtCoreTypeConverters[SBK_QTCORE_QMAP_QSTRING_QVARIANT_IDX], "QVariantMap");
- </inject-code>
-
- <inject-code class="native" position="beginning">
- static bool QVariantType_isStringList(PyObject *list)
- {
- bool allString = true;
- Shiboken::AutoDecRef fast(PySequence_Fast(list, "Failed to convert QVariantList"));
- Py_ssize_t size = PySequence_Fast_GET_SIZE(fast.object());
- for (int i=0; i &lt; size; i++) {
- PyObject *item = PySequence_Fast_GET_ITEM(fast.object(), i);
- if (!%CHECKTYPE[QString](item)) {
- allString = false;
- break;
- }
- }
- return allString;
- }
- static bool QVariantType_checkAllStringKeys(PyObject *dict)
- {
- Shiboken::AutoDecRef keys(PyDict_Keys(dict));
- return QVariantType_isStringList(keys);
- }
- </inject-code>
-
+ <inject-code class="target" position="end" file="../glue/qtcore.cpp" snippet="qvariantmap-register"/>
+ <inject-code class="native" position="beginning" file="../glue/qtcore.cpp" snippet="qvariantmap-check"/>
<primitive-type name="QStringList">
<include file-name="QStringList" location="global"/>
<conversion-rule>
<native-to-target>
<insert-template name="cpplist_to_pylist_conversion">
- <replace from="%INTYPE_0" to="QString" />
+ <replace from="%INTYPE_0" to="QString"/>
</insert-template>
</native-to-target>
<target-to-native>
<add-conversion type="PySequence">
<insert-template name="pyseq_to_cpplist_conversion">
- <replace from="%OUTTYPE_0" to="QString" />
+ <replace from="%OUTTYPE_0" to="QString"/>
</insert-template>
</add-conversion>
</target-to-native>
@@ -728,13 +551,13 @@
<conversion-rule>
<native-to-target>
<insert-template name="cpplist_to_pylist_conversion">
- <replace from="%INTYPE_0" to="QModelIndex" />
+ <replace from="%INTYPE_0" to="QModelIndex"/>
</insert-template>
</native-to-target>
<target-to-native>
<add-conversion type="PySequence">
<insert-template name="pyseq_to_cpplist_conversion">
- <replace from="%OUTTYPE_0" to="QModelIndex" />
+ <replace from="%OUTTYPE_0" to="QModelIndex"/>
</insert-template>
</add-conversion>
</target-to-native>
@@ -958,8 +781,8 @@
<rejection class="Qt" function-name="qt_getEnumName"/>
<namespace-type name="Qt">
- <enum-type name="AlignmentFlag" flags="Alignment" />
- <enum-type name="AnchorPoint" since="4.6" />
+ <enum-type name="AlignmentFlag" flags="Alignment"/>
+ <enum-type name="AnchorPoint" since="4.6"/>
<enum-type name="ApplicationAttribute"/>
<enum-type name="ApplicationState" flags="ApplicationStates" since="5.1"/>
<enum-type name="ArrowType"/>
@@ -975,10 +798,10 @@
<enum-type name="ContextMenuPolicy"/>
<enum-type name="CoordinateSystem" since="4.6"/>
<enum-type name="Corner"/>
- <enum-type name="CursorShape" />
- <enum-type name="DateFormat" />
+ <enum-type name="CursorShape"/>
+ <enum-type name="DateFormat"/>
<enum-type name="DayOfWeek"/>
- <enum-type name="DockWidgetArea" flags="DockWidgetAreas" />
+ <enum-type name="DockWidgetArea" flags="DockWidgetAreas"/>
<enum-type name="DockWidgetAreaSizes"/>
<enum-type name="DropAction" flags="DropActions"/>
<enum-type name="Edge" flags="Edges" since="5.1"/>
@@ -992,15 +815,15 @@
<enum-type name="GestureType" since="4.6"/>
<enum-type name="GlobalColor"/>
<enum-type name="HitTestAccuracy"/>
- <enum-type name="ImageConversionFlag" flags="ImageConversionFlags" />
+ <enum-type name="ImageConversionFlag" flags="ImageConversionFlags"/>
<enum-type name="InputMethodHint" flags="InputMethodHints" since="4.6"/>
- <enum-type name="InputMethodQuery" flags="InputMethodQueries" />
- <enum-type name="EnterKeyType" since="5.6" />
+ <enum-type name="InputMethodQuery" flags="InputMethodQueries"/>
+ <enum-type name="EnterKeyType" since="5.6"/>
<enum-type name="ItemDataRole"/>
<enum-type name="ItemFlag" flags="ItemFlags"/>
<enum-type name="ItemSelectionMode"/>
- <enum-type name="ItemSelectionOperation" since="5.5" />
- <enum-type name="Key" />
+ <enum-type name="ItemSelectionOperation" since="5.5"/>
+ <enum-type name="Key"/>
<enum-type name="KeyboardModifier" flags="KeyboardModifiers"/>
<enum-type name="LayoutDirection"/>
<enum-type name="MaskMode"/>
@@ -1022,7 +845,7 @@
<enum-type name="SizeHint"/>
<enum-type name="SizeMode"/>
<enum-type name="SortOrder"/>
- <enum-type name="TabFocusBehavior" since="5.5" />
+ <enum-type name="TabFocusBehavior" since="5.5"/>
<enum-type name="TextElideMode"/>
<enum-type name="TextFlag"/>
<enum-type name="TextFormat"/>
@@ -1030,14 +853,14 @@
<enum-type name="TileRule" since="4.6"/>
<enum-type name="TimerType" since="5.0"/>
<enum-type name="TimeSpec"/>
- <enum-type name="ToolBarArea" flags="ToolBarAreas" />
+ <enum-type name="ToolBarArea" flags="ToolBarAreas"/>
<enum-type name="ToolBarAreaSizes"/>
<enum-type name="ToolButtonStyle"/>
<enum-type name="TouchPointState" flags="TouchPointStates" since="4.6"/>
<enum-type name="TransformationMode"/>
<enum-type name="UIEffect"/>
- <enum-type name="WhiteSpaceMode" />
- <enum-type name="WidgetAttribute" />
+ <enum-type name="WhiteSpaceMode"/>
+ <enum-type name="WidgetAttribute"/>
<enum-type name="WindowFrameSection"/>
<enum-type name="WindowModality"/>
<enum-type name="WindowState" flags="WindowStates"/>
@@ -1047,53 +870,18 @@
</namespace-type>
<add-function signature="qAbs(double)" return-type="double">
- <inject-code class="target" position="beginning">
- double _abs = qAbs(%1);
- %PYARG_0 = %CONVERTTOPYTHON[double](_abs);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qt-qabs"/>
</add-function>
- <inject-code class="native" position="beginning">
- namespace PySide {
- static QStack&lt;PyObject*&gt; globalPostRoutineFunctions;
- void globalPostRoutineCallback()
- {
- Shiboken::GilState state;
- foreach(PyObject *callback, globalPostRoutineFunctions) {
- Shiboken::AutoDecRef result(PyObject_CallObject(callback, NULL));
- Py_DECREF(callback);
- }
- globalPostRoutineFunctions.clear();
- }
- void addPostRoutine(PyObject *callback)
- {
- if (PyCallable_Check(callback)) {
- globalPostRoutineFunctions &lt;&lt; callback;
- Py_INCREF(callback);
- } else {
- PyErr_SetString(PyExc_TypeError, "qAddPostRoutine: The argument must be a callable object.");
- }
- }
- } // namespace
- </inject-code>
+ <inject-code class="native" position="beginning" file="../glue/qtcore.cpp" snippet="qt-postroutine"/>
<add-function signature="qAddPostRoutine(PyObject*)">
- <inject-code class="target" position="beginning">
- PySide::addPostRoutine(%1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qt-addpostroutine"/>
</add-function>
- <inject-code class="target" position="end">
- qAddPostRoutine(PySide::globalPostRoutineCallback);
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtcore.cpp" snippet="qt-qaddpostroutine"/>
- <inject-code class="target" position="end">
- QList&lt;QByteArray&gt; version = QByteArray(qVersion()).split('.');
- PyObject *pyQtVersion = PyTuple_New(3);
- for (int i = 0; i &lt; 3; ++i)
- PyTuple_SET_ITEM(pyQtVersion, i, PyInt_FromLong(version[i].toInt()));
- PyModule_AddObject(module, "__version_info__", pyQtVersion);
- PyModule_AddStringConstant(module, "__version__", qVersion());
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtcore.cpp" snippet="qt-version"/>
+ <!-- WARNING: There is an issue when adding this code to an external file -->
<inject-code class="target" position="end">
{ // Avoid name clash
Shiboken::AutoDecRef regFunc((PyObject*)NULL);
@@ -1119,61 +907,15 @@
</inject-code>
<add-function signature="__moduleShutdown()">
- <inject-code class="target" position="beginning">
- PySide::runCleanupFunctions();
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="moduleshutdown"/>
</add-function>
<!--signal/slot-->
- <inject-code class="target" position="end">
- Shiboken::Conversions::registerConverterName(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], "unicode");
- Shiboken::Conversions::registerConverterName(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], "str");
- Shiboken::Conversions::registerConverterName(SbkPySide2_QtCoreTypeConverters[SBK_QTCORE_QLIST_QVARIANT_IDX], "QVariantList");
-
- PySide::registerInternalQtConf();
- PySide::init(module);
- Py_AtExit(QtCoreModuleExit);
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtcore.cpp" snippet="qt-pysideinit"/>
- <inject-code class="native" position="beginning">
- // Define a global variable to handle qInstallMessageHandler callback
- static PyObject *qtmsghandler = nullptr;
-
- static void msgHandlerCallback(QtMsgType type, const QMessageLogContext &amp;ctx, const QString &amp;msg)
- {
- Shiboken::GilState state;
- Shiboken::AutoDecRef arglist(PyTuple_New(3));
- PyTuple_SET_ITEM(arglist, 0, %CONVERTTOPYTHON[QtMsgType](type));
- PyTuple_SET_ITEM(arglist, 1, %CONVERTTOPYTHON[QMessageLogContext &amp;](ctx));
- QByteArray array = msg.toLatin1().data();
- char *data = array.data();
- PyTuple_SET_ITEM(arglist, 2, %CONVERTTOPYTHON[char *](data));
- Shiboken::AutoDecRef ret(PyObject_CallObject(qtmsghandler, arglist));
- }
- static void QtCoreModuleExit()
- {
- PySide::SignalManager::instance().clear();
- }
- </inject-code>
+ <inject-code class="native" position="beginning" file="../glue/qtcore.cpp" snippet="qt-messagehandler"/>
<add-function signature="qInstallMessageHandler(PyObject)" return-type="PyObject">
- <inject-code class="target" position="beginning">
- if (%PYARG_1 == Py_None) {
- qInstallMessageHandler(0);
- %PYARG_0 = qtmsghandler ? qtmsghandler : Py_None;
- qtmsghandler = 0;
- } else if (!PyCallable_Check(%PYARG_1)) {
- PyErr_SetString(PyExc_TypeError, "parameter must be callable");
- } else {
- %PYARG_0 = qtmsghandler ? qtmsghandler : Py_None;
- Py_INCREF(%PYARG_1);
- qtmsghandler = %PYARG_1;
- qInstallMessageHandler(msgHandlerCallback);
- }
-
- if (%PYARG_0 == Py_None)
- Py_INCREF(%PYARG_0);
-
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qt-installmessagehandler"/>
</add-function>
<value-type name="QElapsedTimer" since="4.7">
@@ -1190,8 +932,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%i, %i, %i, %i" />
- <replace from="%REPR_ARGS" to="%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()" />
+ <replace from="%REPR_FORMAT" to="%i, %i, %i, %i"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()"/>
</insert-template>
</inject-code>
</add-function>
@@ -1199,35 +941,29 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="iiii" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()" />
+ <replace from="%REDUCE_FORMAT" to="iiii"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()"/>
</insert-template>
</inject-code>
</add-function>
- <inject-code class="native" position="beginning">
- namespace PySide {
- template&lt;&gt; inline uint hash(const QLine &amp;v) {
- return qHash(qMakePair(qMakePair(v.x1(), v.y1()), qMakePair(v.x2(), v.y2())));
- }
- };
- </inject-code>
+ <inject-code class="native" position="beginning" file="../glue/qtcore.cpp" snippet="qline-hash"/>
<add-function signature="toTuple" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="to_tuple">
- <replace from="%TT_FORMAT" to="iiii" />
- <replace from="%TT_ARGS" to="%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()" />
+ <replace from="%TT_FORMAT" to="iiii"/>
+ <replace from="%TT_ARGS" to="%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()"/>
</insert-template>
</inject-code>
</add-function>
</value-type>
<value-type name="QLineF">
- <enum-type name="IntersectType" />
+ <enum-type name="IntersectType"/>
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f, %f, %f" />
- <replace from="%REPR_ARGS" to="%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()" />
+ <replace from="%REPR_FORMAT" to="%f, %f, %f, %f"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()"/>
</insert-template>
</inject-code>
</add-function>
@@ -1235,8 +971,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="dddd" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()" />
+ <replace from="%REDUCE_FORMAT" to="dddd"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()"/>
</insert-template>
</inject-code>
</add-function>
@@ -1244,8 +980,8 @@
<add-function signature="toTuple" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="to_tuple">
- <replace from="%TT_FORMAT" to="dddd" />
- <replace from="%TT_ARGS" to="%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()" />
+ <replace from="%TT_FORMAT" to="dddd"/>
+ <replace from="%TT_ARGS" to="%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()"/>
</insert-template>
</inject-code>
</add-function>
@@ -1254,15 +990,9 @@
<remove-argument />
</modify-argument>
<modify-argument index="return">
- <replace-type modified-type="(intersectType, intersectionPoint)" />
+ <replace-type modified-type="(intersectType, intersectionPoint)"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- QPointF p;
- %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;p);
- %PYARG_0 = PyTuple_New(2);
- PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval));
- PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QPointF](p));
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qlinef-intersect"/>
</modify-function>
</value-type>
<object-type name="QResource">
@@ -1271,17 +1001,9 @@
Returns a read only buffer object pointing to the segment of data that this resource represents. If the resource is compressed the data returns is compressed and qUncompress() must be used to access the data. If the resource is a directory None is returned.
</inject-documentation>
<modify-argument index="return">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code>
- const void *d = %CPPSELF.%FUNCTION_NAME();
- if (d) {
- %PYARG_0 = Shiboken::Buffer::newObject(d, %CPPSELF.size());
- } else {
- Py_INCREF(Py_None);
- %PYARG_0 = Py_None;
- }
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qresource-data"/>
</modify-function>
<template name="QResource_registerResource">
uchar *ptr = reinterpret_cast&lt;uchar*&gt;(Shiboken::Buffer::getPointer(%PYARG_1));
@@ -1294,7 +1016,7 @@
<replace-type modified-type="PyBuffer"/>
</modify-argument>
<inject-code>
- <insert-template name="QResource_registerResource" />
+ <insert-template name="QResource_registerResource"/>
</inject-code>
</modify-function>
<modify-function signature="registerResource(const uchar*,const QString&amp;)" rename="registerResourceData">
@@ -1302,7 +1024,7 @@
<replace-type modified-type="PyBuffer"/>
</modify-argument>
<inject-code>
- <insert-template name="QResource_registerResource" />
+ <insert-template name="QResource_registerResource"/>
</inject-code>
</modify-function>
</object-type>
@@ -1325,7 +1047,7 @@
</template>
<inject-code class="native" position="beginning">
<insert-template name="pydatetime_importandcheck_function">
- <replace from="$DATETIMETYPE" to="PyDate" />
+ <replace from="$DATETIMETYPE" to="PyDate"/>
</insert-template>
</inject-code>
<conversion-rule>
@@ -1348,8 +1070,8 @@
<add-function signature="__repr__" return-type="PyObject">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%i, %i, %i" />
- <replace from="%REPR_ARGS" to="%CPPSELF.year(), %CPPSELF.month(), %CPPSELF.day()" />
+ <replace from="%REPR_FORMAT" to="%i, %i, %i"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.year(), %CPPSELF.month(), %CPPSELF.day()"/>
</insert-template>
</inject-code>
</add-function>
@@ -1357,17 +1079,13 @@
<add-function signature="__reduce__" return-type="PyObject">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="iii" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.year(), %CPPSELF.month(), %CPPSELF.day()" />
+ <replace from="%REDUCE_FORMAT" to="iii"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.year(), %CPPSELF.month(), %CPPSELF.day()"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="toPython()" return-type="PyObject">
- <inject-code class="target" position="beginning">
- if (!PyDateTimeAPI)
- PySideDateTime_IMPORT;
- %PYARG_0 = PyDate_FromDate(%CPPSELF.year(), %CPPSELF.month(), %CPPSELF.day());
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qdate-topython"/>
</add-function>
<modify-function signature="getDate(int*,int*,int*)" >
<modify-argument index="1">
@@ -1382,16 +1100,7 @@
<modify-argument index="return">
<replace-type modified-type="(year, month, day)"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- int year, month, day;
- %BEGIN_ALLOW_THREADS
- %CPPSELF.%FUNCTION_NAME(&amp;year, &amp;month, &amp;day);
- %END_ALLOW_THREADS
- %PYARG_0 = PyTuple_New(3);
- PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](year));
- PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](month));
- PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](day));
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qdate-getdate"/>
</modify-function>
<modify-function signature="weekNumber(int*)const" >
<modify-argument index="1">
@@ -1400,21 +1109,13 @@
<modify-argument index="return">
<replace-type modified-type="(week, yearNumber)"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- int yearNumber;
- %BEGIN_ALLOW_THREADS
- int week = %CPPSELF.%FUNCTION_NAME(&amp;yearNumber);
- %END_ALLOW_THREADS
- %PYARG_0 = PyTuple_New(2);
- PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](week));
- PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](yearNumber));
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qdate-weeknumber"/>
</modify-function>
</value-type>
<value-type name="QDateTime" hash-function="PySide::hash">
<inject-code class="native" position="beginning">
<insert-template name="pydatetime_importandcheck_function">
- <replace from="$DATETIMETYPE" to="PyDateTime" />
+ <replace from="$DATETIMETYPE" to="PyDateTime"/>
</insert-template>
</inject-code>
<conversion-rule>
@@ -1442,52 +1143,39 @@
<modify-argument index="8">
<replace-default-expression with="Qt::LocalTime"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- QDate date(%1, %2, %3);
- QTime time(%4, %5, %6, %7);
- %0 = new %TYPE(date, time, Qt::TimeSpec(%8));
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qdatetime-1"/>
</add-function>
<add-function signature="QDateTime(int,int,int,int,int,int)">
- <inject-code class="target" position="beginning">
- QDate date(%1, %2, %3);
- QTime time(%4, %5, %6);
- %0 = new %TYPE(date, time);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qdatetime-2"/>
</add-function>
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%i, %i, %i, %i, %i, %i, %i, %i" />
- <replace from="%REPR_ARGS" to="%CPPSELF.date().year(), %CPPSELF.date().month(), %CPPSELF.date().day(), %CPPSELF.time().hour(), %CPPSELF.time().minute(), %CPPSELF.time().second(), %CPPSELF.time().msec(), (int)%CPPSELF.timeSpec()" />
+ <replace from="%REPR_FORMAT" to="%i, %i, %i, %i, %i, %i, %i, %i"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.date().year(), %CPPSELF.date().month(), %CPPSELF.date().day(), %CPPSELF.time().hour(), %CPPSELF.time().minute(), %CPPSELF.time().second(), %CPPSELF.time().msec(), (int)%CPPSELF.timeSpec()"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="iiiiiiii" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.date().year(), %CPPSELF.date().month(), %CPPSELF.date().day(), %CPPSELF.time().hour(), %CPPSELF.time().minute(), %CPPSELF.time().second(), %CPPSELF.time().msec(), (int)%CPPSELF.timeSpec()" />
+ <replace from="%REDUCE_FORMAT" to="iiiiiiii"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.date().year(), %CPPSELF.date().month(), %CPPSELF.date().day(), %CPPSELF.time().hour(), %CPPSELF.time().minute(), %CPPSELF.time().second(), %CPPSELF.time().msec(), (int)%CPPSELF.timeSpec()"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="toPython()" return-type="PyObject">
- <inject-code class="target" position="beginning">
- QDate date = %CPPSELF.date();
- QTime time = %CPPSELF.time();
- if (!PyDateTimeAPI) PySideDateTime_IMPORT;
- %PYARG_0 = PyDateTime_FromDateAndTime(date.year(), date.month(), date.day(), time.hour(), time.minute(), time.second(), time.msec()*1000);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qdatetime-topython"/>
</add-function>
</value-type>
<value-type name="QDir">
<enum-type name="Filter" flags="Filters"/>
- <enum-type name="SortFlag" flags="SortFlags" />
+ <enum-type name="SortFlag" flags="SortFlags"/>
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="s" />
- <replace from="%REDUCE_ARGS" to="qPrintable(%CPPSELF.path())" />
+ <replace from="%REDUCE_FORMAT" to="s"/>
+ <replace from="%REDUCE_ARGS" to="qPrintable(%CPPSELF.path())"/>
</insert-template>
</inject-code>
</add-function>
@@ -1497,8 +1185,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%i, %i" />
- <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" />
+ <replace from="%REPR_FORMAT" to="%i, %i"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y()"/>
</insert-template>
</inject-code>
</add-function>
@@ -1506,24 +1194,18 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="ii" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" />
+ <replace from="%REDUCE_FORMAT" to="ii"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y()"/>
</insert-template>
</inject-code>
</add-function>
- <inject-code class="native" position="beginning">
- namespace PySide {
- template&lt;&gt; inline uint hash(const QPoint &amp;v) {
- return qHash(qMakePair(v.x(), v.y()));
- }
- };
- </inject-code>
+ <inject-code class="native" position="beginning" file="../glue/qtcore.cpp" snippet="qpoint"/>
<add-function signature="toTuple" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="to_tuple">
- <replace from="%TT_FORMAT" to="ii" />
- <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" />
+ <replace from="%TT_FORMAT" to="ii"/>
+ <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y()"/>
</insert-template>
</inject-code>
</add-function>
@@ -1537,8 +1219,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f" />
- <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" />
+ <replace from="%REPR_FORMAT" to="%f, %f"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y()"/>
</insert-template>
</inject-code>
</add-function>
@@ -1546,8 +1228,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="dd" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" />
+ <replace from="%REDUCE_FORMAT" to="dd"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y()"/>
</insert-template>
</inject-code>
</add-function>
@@ -1555,8 +1237,8 @@
<add-function signature="toTuple" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="to_tuple">
- <replace from="%TT_FORMAT" to="dd" />
- <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" />
+ <replace from="%TT_FORMAT" to="dd"/>
+ <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y()"/>
</insert-template>
</inject-code>
</add-function>
@@ -1570,30 +1252,24 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%i, %i, %i, %i" />
- <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.width(), %CPPSELF.height()" />
+ <replace from="%REPR_FORMAT" to="%i, %i, %i, %i"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.width(), %CPPSELF.height()"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="iiii" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.width(), %CPPSELF.height()" />
+ <replace from="%REDUCE_FORMAT" to="iiii"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.width(), %CPPSELF.height()"/>
</insert-template>
</inject-code>
</add-function>
- <inject-code class="native" position="beginning">
- namespace PySide {
- template&lt;&gt; inline uint hash(const QRect &amp;v) {
- return qHash(qMakePair(qMakePair(v.x(), v.y()), qMakePair(v.width(), v.height())));
- }
- };
- </inject-code>
+ <inject-code class="native" position="beginning" file="../glue/qtcore.cpp" snippet="qrect"/>
<modify-function signature="getCoords(int*,int*,int*,int*)const">
<modify-argument index="return">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="1">
<remove-argument />
@@ -1609,13 +1285,13 @@
</modify-argument>
<inject-code class="target">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getRect(int*,int*,int*,int*)const">
<modify-argument index="return">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="1">
<remove-argument />
@@ -1631,7 +1307,7 @@
</modify-argument>
<inject-code class="target">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
@@ -1640,8 +1316,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f, %f, %f" />
- <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.width(), %CPPSELF.height()" />
+ <replace from="%REPR_FORMAT" to="%f, %f, %f, %f"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.width(), %CPPSELF.height()"/>
</insert-template>
</inject-code>
</add-function>
@@ -1653,14 +1329,14 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="dddd" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.width(), %CPPSELF.height()" />
+ <replace from="%REDUCE_FORMAT" to="dddd"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.width(), %CPPSELF.height()"/>
</insert-template>
</inject-code>
</add-function>
<modify-function signature="getCoords(qreal*,qreal*,qreal*,qreal*)const">
<modify-argument index="return">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="1">
<remove-argument />
@@ -1676,13 +1352,13 @@
</modify-argument>
<inject-code class="target">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getRect(qreal*,qreal*,qreal*,qreal*)const">
<modify-argument index="return">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="1">
<remove-argument />
@@ -1698,7 +1374,7 @@
</modify-argument>
<inject-code class="target">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
@@ -1707,8 +1383,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%i, %i" />
- <replace from="%REPR_ARGS" to="%CPPSELF.width(), %CPPSELF.height()" />
+ <replace from="%REPR_FORMAT" to="%i, %i"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.width(), %CPPSELF.height()"/>
</insert-template>
</inject-code>
</add-function>
@@ -1716,24 +1392,18 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="ii" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.width(), %CPPSELF.height()" />
+ <replace from="%REDUCE_FORMAT" to="ii"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.width(), %CPPSELF.height()"/>
</insert-template>
</inject-code>
</add-function>
- <inject-code class="native" position="beginning">
- namespace PySide {
- template&lt;&gt; inline uint hash(const QSize &amp;v) {
- return qHash(qMakePair(v.width(), v.height()));
- }
- };
- </inject-code>
+ <inject-code class="native" position="beginning" file="../glue/qtcore.cpp" snippet="qsize"/>
<add-function signature="toTuple" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="to_tuple">
- <replace from="%TT_FORMAT" to="ii" />
- <replace from="%TT_ARGS" to="%CPPSELF.width(), %CPPSELF.height()" />
+ <replace from="%TT_FORMAT" to="ii"/>
+ <replace from="%TT_ARGS" to="%CPPSELF.width(), %CPPSELF.height()"/>
</insert-template>
</inject-code>
</add-function>
@@ -1747,8 +1417,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f" />
- <replace from="%REPR_ARGS" to="%CPPSELF.width(), %CPPSELF.height()" />
+ <replace from="%REPR_FORMAT" to="%f, %f"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.width(), %CPPSELF.height()"/>
</insert-template>
</inject-code>
</add-function>
@@ -1756,8 +1426,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="dd" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.width(), %CPPSELF.height()" />
+ <replace from="%REDUCE_FORMAT" to="dd"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.width(), %CPPSELF.height()"/>
</insert-template>
</inject-code>
</add-function>
@@ -1765,22 +1435,22 @@
<add-function signature="toTuple" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="to_tuple">
- <replace from="%TT_FORMAT" to="dd" />
- <replace from="%TT_ARGS" to="%CPPSELF.width(), %CPPSELF.height()" />
+ <replace from="%TT_FORMAT" to="dd"/>
+ <replace from="%TT_ARGS" to="%CPPSELF.width(), %CPPSELF.height()"/>
</insert-template>
</inject-code>
</add-function>
<!--### Functions removed because they return references to Python imutable objects -->
- <modify-function signature="rheight()" remove="all" />
- <modify-function signature="rwidth()" remove="all" />
+ <modify-function signature="rheight()" remove="all"/>
+ <modify-function signature="rwidth()" remove="all"/>
<!--### -->
</value-type>
<value-type name="QTime" hash-function="PySide::hash">
<inject-code class="native" position="beginning">
<insert-template name="pydatetime_importandcheck_function">
- <replace from="$DATETIMETYPE" to="PyTime" />
+ <replace from="$DATETIMETYPE" to="PyTime"/>
</insert-template>
</inject-code>
<conversion-rule>
@@ -1805,25 +1475,21 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%i, %i, %i, %i" />
- <replace from="%REPR_ARGS" to="%CPPSELF.hour(), %CPPSELF.minute(), %CPPSELF.second(), %CPPSELF.msec()" />
+ <replace from="%REPR_FORMAT" to="%i, %i, %i, %i"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.hour(), %CPPSELF.minute(), %CPPSELF.second(), %CPPSELF.msec()"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="iiii" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.hour(), %CPPSELF.minute(), %CPPSELF.second(), %CPPSELF.msec()" />
+ <replace from="%REDUCE_FORMAT" to="iiii"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.hour(), %CPPSELF.minute(), %CPPSELF.second(), %CPPSELF.msec()"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="toPython()" return-type="PyObject">
- <inject-code class="target" position="beginning">
- if (!PyDateTimeAPI)
- PySideDateTime_IMPORT;
- %PYARG_0 = PyTime_FromTime(%CPPSELF.hour(), %CPPSELF.minute(), %CPPSELF.second(), %CPPSELF.msec()*1000);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qtime-topython"/>
</add-function>
</value-type>
<value-type name="QPersistentModelIndex" hash-function="qHash">
@@ -1847,32 +1513,32 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="'%s'" />
- <replace from="%REPR_ARGS" to="qPrintable(%CPPSELF.toString())" />
+ <replace from="%REPR_FORMAT" to="'%s'"/>
+ <replace from="%REPR_ARGS" to="qPrintable(%CPPSELF.toString())"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="s" />
- <replace from="%REDUCE_ARGS" to="qPrintable(%CPPSELF.toString())" />
+ <replace from="%REDUCE_FORMAT" to="s"/>
+ <replace from="%REDUCE_ARGS" to="qPrintable(%CPPSELF.toString())"/>
</insert-template>
</inject-code>
</add-function>
</value-type>
- <value-type name="QMimeType" since="5.0" />
+ <value-type name="QMimeType" since="5.0"/>
<object-type name="QMimeDatabase" since="5.0">
- <enum-type name="MatchMode" />
+ <enum-type name="MatchMode"/>
</object-type>
<value-type name="QLocale">
- <enum-type name="Country" />
+ <enum-type name="Country"/>
<enum-type name="DataSizeFormat" flags="DataSizeFormats" since="5.10"/>
<enum-type name="FloatingPointPrecisionOption" since="5.7"/>
<enum-type name="FormatType"/>
- <enum-type name="Language" />
+ <enum-type name="Language"/>
<enum-type name="MeasurementSystem"/>
<enum-type name="NumberOption" flags="NumberOptions"/>
<enum-type name="Script" since="4.8" revision="4800"/>
@@ -1888,12 +1554,12 @@
</extra-includes>
<modify-function signature="toTime(QString,QLocale::FormatType)const">
<modify-argument index="2">
- <rename to="format" />
+ <rename to="format"/>
</modify-argument>
</modify-function>
<modify-function signature="toDate(QString,QLocale::FormatType)const">
<modify-argument index="2">
- <rename to="format" />
+ <rename to="format"/>
</modify-argument>
</modify-function>
<!-- Qt5: ignore the new QStringRef versions, int arg is gone -->
@@ -1907,7 +1573,7 @@
<replace-type modified-type="(int, bool ok)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="fix_args,bool*" />
+ <insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
<!-- Qt5: ignore the new QStringRef versions, int arg is gone -->
@@ -1921,7 +1587,7 @@
<replace-type modified-type="(int, bool ok)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="fix_args,bool*" />
+ <insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
<!-- Qt5: ignore the new QStringRef versions -->
@@ -1935,7 +1601,7 @@
<replace-type modified-type="(float, bool ok)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="fix_args,bool*" />
+ <insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
<!-- Qt5: ignore the new QStringRef versions -->
@@ -1949,7 +1615,7 @@
<replace-type modified-type="(float, bool ok)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="fix_args,bool*" />
+ <insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
<!-- Qt5: ignore the new QStringRef versions, int arg is gone -->
@@ -1962,7 +1628,7 @@
<replace-type modified-type="(int, bool ok)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="fix_args,bool*" />
+ <insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
<!-- Qt5: ignore the new QStringRef versions, int arg is gone -->
@@ -1975,7 +1641,7 @@
<replace-type modified-type="(int, bool ok)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="fix_args,bool*" />
+ <insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
<!-- Qt5: ignore the new QStringRef versions, int arg is gone -->
@@ -1988,7 +1654,7 @@
<replace-type modified-type="(int, bool ok)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="fix_args,bool*" />
+ <insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
<!-- Qt5: ignore the new QStringRef versions, int arg is gone -->
@@ -2001,34 +1667,19 @@
<replace-type modified-type="(int, bool ok)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="fix_args,bool*" />
+ <insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
</value-type>
<value-type name="QBitArray" hash-function="qHash" >
<add-function signature="__len__">
- <inject-code class="target" position="beginning">
- return %CPPSELF.size();
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qbitarray-len"/>
</add-function>
<add-function signature="__getitem__">
- <inject-code class="target" position="beginning">
- if (_i &lt; 0 || _i >= %CPPSELF.size()) {
- PyErr_SetString(PyExc_IndexError, "index out of bounds");
- return 0;
- }
- bool ret = %CPPSELF.at(_i);
- return %CONVERTTOPYTHON[bool](ret);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qbitarray-getitem"/>
</add-function>
<add-function signature="__setitem__">
- <inject-code class="target" position="beginning">
- PyObject *args = Py_BuildValue("(iiO)", _i, 1, _value);
- PyObject *result = Sbk_QBitArrayFunc_setBit(self, args);
- Py_DECREF(args);
- Py_XDECREF(result);
- return !result ? -1 : 0;
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qbitarray-setitem"/>
</add-function>
</value-type>
<object-type name="QLockFile">
@@ -2051,12 +1702,10 @@
<reference-count action="set"/>
</modify-argument>
</modify-function>
- <modify-function signature="relock()" allow-thread="yes" />
- <add-function signature="__enter__()" />
+ <modify-function signature="relock()" allow-thread="yes"/>
+ <add-function signature="__enter__()"/>
<add-function signature="__exit__(PyObject*,PyObject*,PyObject*)">
- <inject-code>
- %CPPSELF.unlock();
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="unlock"/>
</add-function>
</object-type>
<object-type name="QWriteLocker">
@@ -2065,12 +1714,10 @@
<reference-count action="set"/>
</modify-argument>
</modify-function>
- <modify-function signature="relock()" allow-thread="yes" />
- <add-function signature="__enter__()" />
+ <modify-function signature="relock()" allow-thread="yes"/>
+ <add-function signature="__enter__()"/>
<add-function signature="__exit__(PyObject*,PyObject*,PyObject*)">
- <inject-code>
- %CPPSELF.unlock();
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="unlock"/>
</add-function>
</object-type>
<object-type name="QDirIterator">
@@ -2079,32 +1726,30 @@
<object-type name="QThread">
<enum-type name="Priority"/>
<modify-function signature="currentThreadId()" remove="all"/>
- <modify-function signature="run()" thread="yes" />
- <modify-function signature="exec()" rename="exec_" allow-thread="yes" />
- <modify-function signature="msleep(unsigned long)" allow-thread="yes" />
- <modify-function signature="sleep(unsigned long)" allow-thread="yes" />
- <modify-function signature="usleep(unsigned long)" allow-thread="yes" />
- <modify-function signature="wait(unsigned long)" allow-thread="yes" />
+ <modify-function signature="run()" thread="yes"/>
+ <modify-function signature="exec()" rename="exec_" allow-thread="yes"/>
+ <modify-function signature="msleep(unsigned long)" allow-thread="yes"/>
+ <modify-function signature="sleep(unsigned long)" allow-thread="yes"/>
+ <modify-function signature="usleep(unsigned long)" allow-thread="yes"/>
+ <modify-function signature="wait(unsigned long)" allow-thread="yes"/>
<modify-function signature="start(QThread::Priority)" allow-thread="yes">
<modify-argument index="1">
<rename to="priority"/>
</modify-argument>
</modify-function>
- <modify-function signature="exit(int)" allow-thread="yes" />
+ <modify-function signature="exit(int)" allow-thread="yes"/>
</object-type>
<object-type name="QAbstractItemModel">
<enum-type name="CheckIndexOption" flags="CheckIndexOptions" since="5.11"/>
- <enum-type name="LayoutChangeHint" />
+ <enum-type name="LayoutChangeHint"/>
<!-- This function is the same as createIndex(int, int, int)const -->
<modify-function signature="createIndex(int,int,quintptr)const">
<modify-argument index="3">
- <replace-default-expression with="0" />
+ <replace-default-expression with="0"/>
</modify-argument>
</modify-function>
- <inject-code class="target" position="end">
- qRegisterMetaType&lt;QVector&lt;int&gt; &gt;("QVector&lt;int&gt;");
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtcore.cpp" snippet="qabstractitemmodel"/>
<modify-function signature="mimeData(QModelIndexList)const">
<modify-argument index="return">
<define-ownership class="native" owner="c++"/>
@@ -2159,13 +1804,10 @@
<extra-includes>
<include file-name="QThread" location="global"/>
<include file-name="QCoreApplication" location="global"/>
- <include file-name="signalmanager.h" location="local" />
+ <include file-name="signalmanager.h" location="local"/>
</extra-includes>
<modify-function signature="metaObject()const">
- <inject-code class="target" position="beginning">
- %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME();
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-metaobject"/>
<modify-argument index="return">
<reference-count action="set"/>
</modify-argument>
@@ -2210,88 +1852,53 @@
<modify-argument index="4">
<rename to="type"/>
</modify-argument>
- <inject-code class="target" position="beginning" file="">
- // %FUNCTION_NAME() - disable generation of function call.
- bool %0 = qobjectConnect(%1, %2, %CPPSELF, %3, %4);
- %PYARG_0 = %CONVERTTOPYTHON[bool](%0);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-connect-1"/>
</modify-function>
<!-- static version -->
<modify-function signature="connect(const QObject*,QMetaMethod,const QObject*,QMetaMethod,Qt::ConnectionType)">
<modify-argument index="5">
<rename to="type"/>
</modify-argument>
- <inject-code class="target" position="beginning" file="">
- // %FUNCTION_NAME() - disable generation of function call.
- bool %0 = qobjectConnect(%1, %2, %3, %4, %5);
- %PYARG_0 = %CONVERTTOPYTHON[bool](%0);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-connect-2"/>
</modify-function>
<modify-function signature="connect(const QObject*,const char*,const QObject*,const char*,Qt::ConnectionType)">
<modify-argument index="5">
<rename to="type"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- // %FUNCTION_NAME() - disable generation of function call.
- bool %0 = qobjectConnect(%1, %2, %3, %4, %5);
- %PYARG_0 = %CONVERTTOPYTHON[bool](%0);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-connect-3"/>
</modify-function>
- <inject-code class="native" position="beginning" file="glue/qobject_connect.cpp" />
+ <inject-code class="native" position="beginning" file="glue/qobject_connect.cpp"/>
<add-function signature="connect(const QObject*,const char*,PyCallable*,Qt::ConnectionType)" return-type="bool" static="yes">
<modify-argument index="4">
<rename to="type"/>
- <replace-default-expression with="Qt::AutoConnection" />
+ <replace-default-expression with="Qt::AutoConnection"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- // %FUNCTION_NAME() - disable generation of function call.
- %RETURN_TYPE %0 = qobjectConnectCallback(%1, %2, %PYARG_3, %4);
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-connect-4"/>
</add-function>
<!-- static version -->
<add-function signature="connect(const char*,PyCallable*,Qt::ConnectionType)" return-type="bool">
<modify-argument index="3">
<rename to="type"/>
- <replace-default-expression with="Qt::AutoConnection" />
+ <replace-default-expression with="Qt::AutoConnection"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- // %FUNCTION_NAME() - disable generation of function call.
- %RETURN_TYPE %0 = qobjectConnectCallback(%CPPSELF, %1, %PYARG_2, %3);
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-connect-5"/>
</add-function>
<add-function signature="connect(const char*,const QObject*,const char*,Qt::ConnectionType)" return-type="bool">
<modify-argument index="4">
<rename to="type"/>
- <replace-default-expression with="Qt::AutoConnection" />
+ <replace-default-expression with="Qt::AutoConnection"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- // %FUNCTION_NAME() - disable generation of function call.
- %RETURN_TYPE %0 = qobjectConnect(%CPPSELF, %1, %2, %3, %4);
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-connect-6"/>
</add-function>
<add-function signature="emit(const char*,...)" return-type="bool">
- <inject-code class="target" position="beginning">
- %RETURN_TYPE %0 = PySide::SignalManager::instance().emitSignal(%CPPSELF, %1, %PYARG_2);
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-emit"/>
</add-function>
<add-function signature="disconnect(const char*,PyCallable*)" return-type="bool">
- <inject-code class="target" position="beginning">
- // %FUNCTION_NAME() - disable generation of function call.
- %RETURN_TYPE %0 = qobjectDisconnectCallback(%CPPSELF, %1, %2);
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-disconnect-1"/>
</add-function>
<add-function signature="disconnect(const QObject*,const char*,PyCallable*)" return-type="bool" static="yes">
- <inject-code class="target" position="beginning">
- // %FUNCTION_NAME() - disable generation of function call.
- %RETURN_TYPE %0 = qobjectDisconnectCallback(%1, %2, %3);
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-disconnect-2"/>
</add-function>
@@ -2310,37 +1917,28 @@
child2 = parent.findChild(QWidget, "child_widget")
</inject-documentation>
- <inject-code class="target" position="beginning">
- QObject *child = _findChildHelper(%CPPSELF, %2, (PyTypeObject*)%PYARG_1);
- %PYARG_0 = %CONVERTTOPYTHON[QObject*](child);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-findchild"/>
<modify-argument index="return">
<parent index="this" action="add"/>
</modify-argument>
<modify-argument index="2">
- <replace-default-expression with="QString()" />
+ <replace-default-expression with="QString()"/>
</modify-argument>
</add-function>
<add-function signature="findChildren(PyTypeObject*,const QString&amp;)" return-type="PySequence*" >
<inject-documentation format="target" mode="append">
Like the method *findChild*, the first parameter should be the child's type.
</inject-documentation>
- <inject-code class="target" position="beginning">
- %PYARG_0 = PyList_New(0);
- _findChildrenHelper(%CPPSELF, %2, (PyTypeObject*)%PYARG_1, %PYARG_0);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-findchildren-1"/>
<modify-argument index="return">
<parent index="this" action="add"/>
</modify-argument>
<modify-argument index="2">
- <replace-default-expression with="QString()" />
+ <replace-default-expression with="QString()"/>
</modify-argument>
</add-function>
<add-function signature="findChildren(PyTypeObject*,const QRegExp&amp;)" return-type="PySequence*" >
- <inject-code class="target" position="beginning">
- %PYARG_0 = PyList_New(0);
- _findChildrenHelper(%CPPSELF, %2, (PyTypeObject*)%PYARG_1, %PYARG_0);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-findchildren-2"/>
<modify-argument index="return">
<parent index="this" action="add"/>
</modify-argument>
@@ -2354,33 +1952,11 @@
<replace-default-expression with="-1"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- QString result;
- if (QCoreApplication::instance()) {
- PyObject *klass = PyObject_GetAttrString(%PYSELF, "__class__");
- PyObject *cname = PyObject_GetAttrString(klass, "__name__");
- result = QString(QCoreApplication::instance()->translate(Shiboken::String::toCString(cname),
- /* %1, %2, QCoreApplication::CodecForTr, %3)); */
- %1, %2, %3));
-
- Py_DECREF(klass);
- Py_DECREF(cname);
- } else {
- result = QString(QString::fromLatin1(%1));
- }
- %PYARG_0 = %CONVERTTOPYTHON[QString](result);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-tr"/>
</add-function>
<modify-function signature="receivers(const char*)const">
- <inject-code class="target" position="beginning">
- // Avoid return +1 because SignalManager connect to "destroyed()" signal to control object timelife
- int ret = %CPPSELF.%FUNCTION_NAME(%1);
- if (ret > 0 &amp;&amp; ((strcmp(%1, SIGNAL(destroyed())) == 0) || (strcmp(%1, SIGNAL(destroyed(QObject*))) == 0)))
- ret -= PySide::SignalManager::instance().countConnectionsWith(%CPPSELF);
-
- %PYARG_0 = %CONVERTTOPYTHON[int](ret);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-receivers"/>
</modify-function>
<modify-function signature="destroyed(QObject*)">
@@ -2414,12 +1990,12 @@
<include file-name="QSize" location="global"/>
</extra-includes>
</object-type>
- <value-type name="QUrlQuery" since="5.0" />
+ <value-type name="QUrlQuery" since="5.0"/>
<value-type name="QUrl" hash-function="PySide::hash">
<!-- Qt5: lots of changes -->
<enum-type name="ComponentFormattingOption" flags="ComponentFormattingOptions,FormattingOptions"/>
<!-- note: above duplication of attribute is not by default XML compliant! -->
- <enum-type name="UrlFormattingOption" />
+ <enum-type name="UrlFormattingOption"/>
<enum-type name="UserInputResolutionOption" flags="UserInputResolutionOptions"/>
<enum-type name="ParsingMode"/>
<extra-includes>
@@ -2428,8 +2004,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="'%s'" />
- <replace from="%REPR_ARGS" to="qPrintable(%CPPSELF.toString())" />
+ <replace from="%REPR_FORMAT" to="'%s'"/>
+ <replace from="%REPR_ARGS" to="qPrintable(%CPPSELF.toString())"/>
</insert-template>
</inject-code>
</add-function>
@@ -2437,8 +2013,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="s" />
- <replace from="%REDUCE_ARGS" to="qPrintable(%CPPSELF.toString())" />
+ <replace from="%REDUCE_FORMAT" to="s"/>
+ <replace from="%REDUCE_ARGS" to="qPrintable(%CPPSELF.toString())"/>
</insert-template>
</inject-code>
</add-function>
@@ -2452,8 +2028,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="'%s', %i, %i" />
- <replace from="%REPR_ARGS" to="qPrintable(%CPPSELF.pattern()), (int)%CPPSELF.caseSensitivity(), (int)%CPPSELF.patternSyntax()" />
+ <replace from="%REPR_FORMAT" to="'%s', %i, %i"/>
+ <replace from="%REPR_ARGS" to="qPrintable(%CPPSELF.pattern()), (int)%CPPSELF.caseSensitivity(), (int)%CPPSELF.patternSyntax()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2461,8 +2037,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="sii" />
- <replace from="%REDUCE_ARGS" to="qPrintable(%CPPSELF.pattern()), (int)%CPPSELF.caseSensitivity(), (int)%CPPSELF.patternSyntax()" />
+ <replace from="%REDUCE_FORMAT" to="sii"/>
+ <replace from="%REDUCE_ARGS" to="qPrintable(%CPPSELF.pattern()), (int)%CPPSELF.caseSensitivity(), (int)%CPPSELF.patternSyntax()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2496,10 +2072,7 @@
# t == "A \\emph{bon mot}."
</inject-documentation>
- <inject-code class="target" position="beginning">
- %1.replace(*%CPPSELF, %2);
- %PYARG_0 = %CONVERTTOPYTHON[QString](%1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qregexp-replace"/>
</add-function>
</value-type>
@@ -2519,8 +2092,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="s" />
- <replace from="%REDUCE_ARGS" to="qPrintable(%CPPSELF.filePath())" />
+ <replace from="%REDUCE_FORMAT" to="s"/>
+ <replace from="%REDUCE_ARGS" to="qPrintable(%CPPSELF.filePath())"/>
</insert-template>
</inject-code>
</add-function>
@@ -2553,204 +2126,118 @@
</extra-includes>
<!-- ### These overloads must be removed accept strings with \x00 in their contents -->
- <modify-function signature="append(const char*,int)" remove="all" />
- <modify-function signature="append(const char*)" remove="all" />
- <modify-function signature="append(QString)" remove="all" />
- <modify-function signature="contains(const char*)const" remove="all" />
- <modify-function signature="count(const char*)const" remove="all" />
- <modify-function signature="endsWith(const char*)const" remove="all" />
- <modify-function signature="indexOf(const char*,int)const" remove="all" />
- <modify-function signature="indexOf(char,int)const" remove="all" />
- <modify-function signature="indexOf(QString,int)const" remove="all" />
- <modify-function signature="insert(int,const char*)" remove="all" />
- <modify-function signature="insert(int,char)" remove="all" />
- <modify-function signature="insert(int,const char*,int)" since="4.6" remove="all" />
- <modify-function signature="insert(int,QString)" remove="all" />
- <modify-function signature="lastIndexOf(const char*,int)const" remove="all" />
- <modify-function signature="lastIndexOf(QString,int)const" remove="all" />
- <modify-function signature="lastIndexOf(char,int)const" remove="all" />
- <modify-function signature="prepend(const char*)" remove="all" />
- <modify-function signature="prepend(const char*,int)" since="4.6" remove="all" />
- <modify-function signature="replace(QByteArray,const char*)" remove="all" />
+ <modify-function signature="append(const char*,int)" remove="all"/>
+ <modify-function signature="append(const char*)" remove="all"/>
+ <modify-function signature="append(QString)" remove="all"/>
+ <modify-function signature="contains(const char*)const" remove="all"/>
+ <modify-function signature="count(const char*)const" remove="all"/>
+ <modify-function signature="endsWith(const char*)const" remove="all"/>
+ <modify-function signature="indexOf(const char*,int)const" remove="all"/>
+ <modify-function signature="indexOf(char,int)const" remove="all"/>
+ <modify-function signature="indexOf(QString,int)const" remove="all"/>
+ <modify-function signature="insert(int,const char*)" remove="all"/>
+ <modify-function signature="insert(int,char)" remove="all"/>
+ <modify-function signature="insert(int,const char*,int)" since="4.6" remove="all"/>
+ <modify-function signature="insert(int,QString)" remove="all"/>
+ <modify-function signature="lastIndexOf(const char*,int)const" remove="all"/>
+ <modify-function signature="lastIndexOf(QString,int)const" remove="all"/>
+ <modify-function signature="lastIndexOf(char,int)const" remove="all"/>
+ <modify-function signature="prepend(const char*)" remove="all"/>
+ <modify-function signature="prepend(const char*,int)" since="4.6" remove="all"/>
+ <modify-function signature="replace(QByteArray,const char*)" remove="all"/>
<modify-function signature="replace(const char*,int,const char*,int)" remove="all"/>
- <modify-function signature="replace(QString,const char*)" remove="all" />
- <modify-function signature="replace(const char*,QByteArray)" remove="all" />
- <modify-function signature="replace(const char*,const char*)" remove="all" />
- <modify-function signature="replace(int,int,const char*)" remove="all" />
- <modify-function signature="replace(int,int,const char*,int)" since="4.6" remove="all" />
- <modify-function signature="replace(char,const char*)" remove="all" />
- <modify-function signature="replace(char,QString)" remove="all" />
- <modify-function signature="startsWith(const char*)const" remove="all" />
- <modify-function signature="operator==(QString)const" remove="all" />
- <modify-function signature="operator==(const char*,QByteArray)" remove="all" />
- <modify-function signature="operator==(QByteArray,const char*)" remove="all" />
- <modify-function signature="operator>(QString)const" remove="all" />
- <modify-function signature="operator>(const char*,QByteArray)" remove="all" />
- <modify-function signature="operator>(QByteArray,const char*)" remove="all" />
- <modify-function signature="operator>=(QString)const" remove="all" />
- <modify-function signature="operator>=(const char*,QByteArray)" remove="all" />
- <modify-function signature="operator>=(QByteArray,const char*)" remove="all" />
- <modify-function signature="operator&lt;(QString)const" remove="all" />
- <modify-function signature="operator&lt;(const char*,QByteArray)" remove="all" />
- <modify-function signature="operator&lt;=(QString)const" remove="all" />
- <modify-function signature="operator&lt;=(const char*,QByteArray)" remove="all" />
- <modify-function signature="operator&lt;=(QByteArray,const char*)" remove="all" />
- <modify-function signature="operator!=(QString)const" remove="all" />
- <modify-function signature="operator!=(const char*,QByteArray)" remove="all" />
- <modify-function signature="operator!=(QByteArray,const char*)" remove="all" />
- <modify-function signature="operator+=(QString)" remove="all" />
- <modify-function signature="operator+=(const char*)" remove="all" />
- <modify-function signature="operator+(QByteArray,const char*)" remove="all" />
- <modify-function signature="operator+(const char*,QByteArray)" remove="all" />
- <modify-function signature="operator+(QByteArray,const char*)" remove="all" />
- <modify-function signature="operator+(QString,QByteArray)" remove="all" />
- <modify-function signature="operator+(QByteArray,QString)" remove="all" />
+ <modify-function signature="replace(QString,const char*)" remove="all"/>
+ <modify-function signature="replace(const char*,QByteArray)" remove="all"/>
+ <modify-function signature="replace(const char*,const char*)" remove="all"/>
+ <modify-function signature="replace(int,int,const char*)" remove="all"/>
+ <modify-function signature="replace(int,int,const char*,int)" since="4.6" remove="all"/>
+ <modify-function signature="replace(char,const char*)" remove="all"/>
+ <modify-function signature="replace(char,QString)" remove="all"/>
+ <modify-function signature="startsWith(const char*)const" remove="all"/>
+ <modify-function signature="operator==(QString)const" remove="all"/>
+ <modify-function signature="operator==(const char*,QByteArray)" remove="all"/>
+ <modify-function signature="operator==(QByteArray,const char*)" remove="all"/>
+ <modify-function signature="operator>(QString)const" remove="all"/>
+ <modify-function signature="operator>(const char*,QByteArray)" remove="all"/>
+ <modify-function signature="operator>(QByteArray,const char*)" remove="all"/>
+ <modify-function signature="operator>=(QString)const" remove="all"/>
+ <modify-function signature="operator>=(const char*,QByteArray)" remove="all"/>
+ <modify-function signature="operator>=(QByteArray,const char*)" remove="all"/>
+ <modify-function signature="operator&lt;(QString)const" remove="all"/>
+ <modify-function signature="operator&lt;(const char*,QByteArray)" remove="all"/>
+ <modify-function signature="operator&lt;=(QString)const" remove="all"/>
+ <modify-function signature="operator&lt;=(const char*,QByteArray)" remove="all"/>
+ <modify-function signature="operator&lt;=(QByteArray,const char*)" remove="all"/>
+ <modify-function signature="operator!=(QString)const" remove="all"/>
+ <modify-function signature="operator!=(const char*,QByteArray)" remove="all"/>
+ <modify-function signature="operator!=(QByteArray,const char*)" remove="all"/>
+ <modify-function signature="operator+=(QString)" remove="all"/>
+ <modify-function signature="operator+=(const char*)" remove="all"/>
+ <modify-function signature="operator+(QByteArray,const char*)" remove="all"/>
+ <modify-function signature="operator+(const char*,QByteArray)" remove="all"/>
+ <modify-function signature="operator+(QByteArray,const char*)" remove="all"/>
+ <modify-function signature="operator+(QString,QByteArray)" remove="all"/>
+ <modify-function signature="operator+(QByteArray,QString)" remove="all"/>
<add-function signature="operator+(PyBytes,QByteArray)">
- <inject-code>
- QByteArray ba = QByteArray(PyBytes_AS_STRING(%PYARG_1), PyBytes_GET_SIZE(%PYARG_1)) + *%CPPSELF;
- %PYARG_0 = %CONVERTTOPYTHON[QByteArray](ba);
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qbytearray-operatorplus-1"/>
</add-function>
<add-function signature="operator+(PyByteArray, QByteArray)" return-type="QByteArray">
- <inject-code>
- QByteArray ba = QByteArray(PyByteArray_AsString(%PYARG_1), PyByteArray_Size(%PYARG_1)) + *%CPPSELF;
- %PYARG_0 = %CONVERTTOPYTHON[QByteArray](ba);
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qbytearray-operatorplus-2"/>
</add-function>
<add-function signature="operator+(PyByteArray)" return-type="QByteArray">
- <inject-code>
- QByteArray ba = *%CPPSELF + QByteArray(PyByteArray_AsString(%PYARG_1), PyByteArray_Size(%PYARG_1));
- %PYARG_0 = %CONVERTTOPYTHON[QByteArray](ba);
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qbytearray-operatorplus-3"/>
</add-function>
<add-function signature="operator+=(PyByteArray)" return-type="QByteArray">
- <inject-code>
- *%CPPSELF += QByteArray(PyByteArray_AsString(%PYARG_1), PyByteArray_Size(%PYARG_1));
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qbytearray-operatorplusequal"/>
</add-function>
<add-function signature="operator==(PyUnicode)">
- <inject-code>
- if (PyUnicode_CheckExact(%PYARG_1)) {
- Shiboken::AutoDecRef data(PyUnicode_AsASCIIString(%PYARG_1));
- QByteArray ba = QByteArray(PyBytes_AsString(data.object()), PyBytes_GET_SIZE(data.object()));
- bool cppResult = %CPPSELF == ba;
- %PYARG_0 = %CONVERTTOPYTHON[bool](cppResult);
- }
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qbytearray-operatorequalequal"/>
</add-function>
<add-function signature="operator!=(PyUnicode)">
- <inject-code>
- if (PyUnicode_CheckExact(%PYARG_1)) {
- Shiboken::AutoDecRef data(PyUnicode_AsASCIIString(%PYARG_1));
- QByteArray ba = QByteArray(PyBytes_AsString(data.object()), PyBytes_GET_SIZE(data.object()));
- bool cppResult = %CPPSELF != ba;
- %PYARG_0 = %CONVERTTOPYTHON[bool](cppResult);
- }
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qbytearray-operatornotequal"/>
</add-function>
<add-function signature="operator&gt;(PyUnicode)">
- <inject-code>
- if (PyUnicode_CheckExact(%PYARG_1)) {
- Shiboken::AutoDecRef data(PyUnicode_AsASCIIString(%PYARG_1));
- QByteArray ba = QByteArray(PyBytes_AsString(data.object()), PyBytes_GET_SIZE(data.object()));
- bool cppResult = %CPPSELF &gt; ba;
- %PYARG_0 = %CONVERTTOPYTHON[bool](cppResult);
- }
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qbytearray-operatorgreater"/>
</add-function>
<add-function signature="operator&gt;=(PyUnicode)">
- <inject-code>
- if (PyUnicode_CheckExact(%PYARG_1)) {
- Shiboken::AutoDecRef data(PyUnicode_AsASCIIString(%PYARG_1));
- QByteArray ba = QByteArray(PyBytes_AsString(data.object()), PyBytes_GET_SIZE(data.object()));
- bool cppResult = %CPPSELF &gt;= ba;
- %PYARG_0 = %CONVERTTOPYTHON[bool](cppResult);
- }
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qbytearray-operatorgreaterequal"/>
</add-function>
<add-function signature="operator&lt;(PyUnicode)">
- <inject-code>
- if (PyUnicode_CheckExact(%PYARG_1)) {
- Shiboken::AutoDecRef data(PyUnicode_AsASCIIString(%PYARG_1));
- QByteArray ba = QByteArray(PyBytes_AsString(data.object()), PyBytes_GET_SIZE(data.object()));
- bool cppResult = %CPPSELF &lt; ba;
- %PYARG_0 = %CONVERTTOPYTHON[bool](cppResult);
- }
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qbytearray-operatorlower"/>
</add-function>
<add-function signature="operator&lt;=(PyUnicode)">
- <inject-code>
- if (PyUnicode_CheckExact(%PYARG_1)) {
- Shiboken::AutoDecRef data(PyUnicode_AsASCIIString(%PYARG_1));
- QByteArray ba = QByteArray(PyBytes_AsString(data.object()), PyBytes_GET_SIZE(data.object()));
- bool cppResult = %CPPSELF &lt;= ba;
- %PYARG_0 = %CONVERTTOPYTHON[bool](cppResult);
- }
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qbytearray-operatorlowerequal"/>
</add-function>
<!-- ### -->
<add-function signature="__repr__" return-type="PyObject*">
- <inject-code class="target" position="beginning">
- PyObject *aux = PyBytes_FromStringAndSize(%CPPSELF.constData(), %CPPSELF.size());
- if (aux == NULL) {
- return NULL;
- }
- QByteArray b(Py_TYPE(%PYSELF)->tp_name);
- #ifdef IS_PY3K
- %PYARG_0 = PyUnicode_FromFormat("%s(%R)", b.constData(), aux);
- #else
- aux = PyObject_Repr(aux);
- b += "(";
- b += QByteArray(PyBytes_AS_STRING(aux), PyBytes_GET_SIZE(aux));
- b += ")";
- %PYARG_0 = Shiboken::String::fromStringAndSize(b.constData(), b.size());
- #endif
- Py_DECREF(aux);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qbytearray-repr"/>
</add-function>
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="N" />
- <replace from="%REDUCE_ARGS" to="PyBytes_FromStringAndSize(%CPPSELF.constData(), %CPPSELF.size())" />
+ <replace from="%REDUCE_FORMAT" to="N"/>
+ <replace from="%REDUCE_ARGS" to="PyBytes_FromStringAndSize(%CPPSELF.constData(), %CPPSELF.size())"/>
</insert-template>
</inject-code>
</add-function>
<modify-function signature="QByteArray(const char*,int)">
<!-- Keep \x00 bytes passed in python strings -->
- <inject-code class="target" position="beginning">
- if (PyBytes_Check(%PYARG_1)) {
- %0 = new QByteArray(PyBytes_AsString(%PYARG_1), PyBytes_GET_SIZE(%PYARG_1));
- } else if (Shiboken::String::check(%PYARG_1)) {
- %0 = new QByteArray(Shiboken::String::toCString(%PYARG_1), Shiboken::String::len(%PYARG_1));
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qbytearray-1"/>
</modify-function>
<add-function signature="QByteArray(PyByteArray)">
- <inject-code class="target" position="beginning">
- %0 = new QByteArray(PyByteArray_AsString(%PYARG_1), PyByteArray_Size(%PYARG_1));
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qbytearray-2"/>
</add-function>
<add-function signature="QByteArray(PyBytes)">
- <inject-code class="target" position="beginning">
- %0 = new QByteArray(PyBytes_AS_STRING(%PYARG_1), PyBytes_GET_SIZE(%PYARG_1));
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qbytearray-3"/>
</add-function>
<!-- buffer protocol -->
- <inject-code class="native" position="beginning" file="glue/qbytearray_bufferprotocol.cpp" />
- <inject-code class="target" position="end">
- #if PY_VERSION_HEX &lt; 0x03000000
- Shiboken::SbkType&lt;QByteArray>()->tp_as_buffer = &amp;SbkQByteArrayBufferProc;
- Shiboken::SbkType&lt;QByteArray>()->tp_flags |= Py_TPFLAGS_HAVE_GETCHARBUFFER;
- #endif
- </inject-code>
+ <inject-code class="native" position="beginning" file="glue/qbytearray_bufferprotocol.cpp"/>
+ <inject-code class="target" position="end" file="../glue/qtcore.cpp" snippet="qbytearray-py3"/>
<modify-function signature="data()">
- <inject-code class="target" position="beginning">
- %PYARG_0 = PyBytes_FromStringAndSize(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.size());
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qbytearray-data"/>
</modify-function>
<!-- removed functions -->
@@ -2769,12 +2256,12 @@
<modify-function signature="number(qulonglong,int)" remove="all"/>
<modify-function signature="operator+=(const char*)" remove="all"/>
<modify-function signature="operator+(char,QByteArray)" remove="all"/>
- <modify-function signature="operator==(const char*,QByteArray)" remove="all" />
- <modify-function signature="operator!=(const char*,QByteArray)" remove="all" />
- <modify-function signature="operator&lt;(const char*,QByteArray)" remove="all" />
- <modify-function signature="operator&lt;=(const char*,QByteArray)" remove="all" />
- <modify-function signature="operator>(const char*,QByteArray)" remove="all" />
- <modify-function signature="operator>=(const char*,QByteArray)" remove="all" />
+ <modify-function signature="operator==(const char*,QByteArray)" remove="all"/>
+ <modify-function signature="operator!=(const char*,QByteArray)" remove="all"/>
+ <modify-function signature="operator&lt;(const char*,QByteArray)" remove="all"/>
+ <modify-function signature="operator&lt;=(const char*,QByteArray)" remove="all"/>
+ <modify-function signature="operator>(const char*,QByteArray)" remove="all"/>
+ <modify-function signature="operator>=(const char*,QByteArray)" remove="all"/>
<modify-function signature="operator[](int)const" remove="all"/>
<modify-function signature="operator[](uint)const" remove="all"/>
<!-- Those types have the same representation in Python, an overload would be useless. -->
@@ -2871,10 +2358,7 @@
<modify-argument index="2">
<remove-argument />
</modify-argument>
- <inject-code class="target">
- %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(PyBytes_AsString(%PYARG_1), PyBytes_GET_SIZE(%PYARG_1));
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
- </inject-code>
+ <inject-code class="target" file="../glue/qtcore.cpp" snippet="qbytearray-fromrawdata"/>
</modify-function>
<modify-function signature="toDouble(bool*)const">
<modify-argument index="1">
@@ -2893,52 +2377,22 @@
</inject-code>
</modify-function>
<add-function signature="__str__" return-type="PyObject*">
- <inject-code class="target" position="beginning">
- PyObject *aux = PyBytes_FromStringAndSize(%CPPSELF.constData(), %CPPSELF.size());
- if (aux == NULL) {
- return NULL;
- }
- #ifdef IS_PY3K
- %PYARG_0 = PyObject_Repr(aux);
- Py_DECREF(aux);
- #else
- %PYARG_0 = aux;
- #endif
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qbytearray-str"/>
</add-function>
<add-function signature="__len__">
- <inject-code class="target" position="beginning">
- return %CPPSELF.count();
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qbytearray-len"/>
</add-function>
<add-function signature="__getitem__">
- <inject-code class="target" position="beginning">
- if (_i &lt; 0 || _i >= %CPPSELF.size()) {
- PyErr_SetString(PyExc_IndexError, "index out of bounds");
- return 0;
- } else {
- char res[2];
- res[0] = %CPPSELF.at(_i);
- res[1] = 0;
- return PyBytes_FromStringAndSize(res, 1);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qbytearray-getitem"/>
</add-function>
<add-function signature="__mgetitem__">
- <inject-code class="target" position="beginning" file="glue/qbytearray_mgetitem.cpp" />
+ <inject-code class="target" position="beginning" file="glue/qbytearray_mgetitem.cpp"/>
</add-function>
<add-function signature="__setitem__">
- <inject-code class="target" position="beginning">
- %CPPSELF.remove(_i, 1);
- PyObject *args = Py_BuildValue("(nO)", _i, _value);
- PyObject *result = Sbk_QByteArrayFunc_insert(self, args);
- Py_DECREF(args);
- Py_XDECREF(result);
- return !result ? -1 : 0;
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qbytearray-setitem"/>
</add-function>
<add-function signature="__msetitem__">
- <inject-code class="target" position="beginning" file="glue/qbytearray_msetitem.cpp" />
+ <inject-code class="target" position="beginning" file="glue/qbytearray_msetitem.cpp"/>
</add-function>
</value-type>
<value-type name="QTextBoundaryFinder">
@@ -2973,9 +2427,9 @@
<object-type name="QEventLoop">
<enum-type name="ProcessEventsFlag" flags="ProcessEventsFlags"/>
- <modify-function signature="exec(QFlags&lt;QEventLoop::ProcessEventsFlag>)" rename="exec_" allow-thread="yes" />
- <modify-function signature="processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag>)" allow-thread="yes" />
- <modify-function signature="processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag>,int)" allow-thread="yes" />
+ <modify-function signature="exec(QFlags&lt;QEventLoop::ProcessEventsFlag>)" rename="exec_" allow-thread="yes"/>
+ <modify-function signature="processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag>)" allow-thread="yes"/>
+ <modify-function signature="processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag>,int)" allow-thread="yes"/>
</object-type>
<object-type name="QFileDevice" since="5.0">
<enum-type name="FileError"/>
@@ -2990,19 +2444,13 @@
<modify-argument index="1">
<replace-type modified-type="PyBuffer"/>
</modify-argument>
- <inject-code>
- uchar *ptr = reinterpret_cast&lt;uchar*&gt;(Shiboken::Buffer::getPointer(%PYARG_1));
- %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(ptr);
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qfiledevice-unmap"/>
</modify-function>
<modify-function signature="map(qint64,qint64,QFileDevice::MemoryMapFlags)">
<modify-argument index="return">
<replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code>
- %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1, %2, %3), %2, Shiboken::Buffer::ReadWrite);
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qfiledevice-map"/>
</modify-function>
<modify-function signature="flush()" allow-thread="yes"/>
</object-type>
@@ -3017,7 +2465,7 @@
<modify-function signature="rename(const QString&amp;,const QString&amp;)" allow-thread="yes"/>
</object-type>
<object-type name="QSaveFile"/>
- <object-type name="QFileSelector" />
+ <object-type name="QFileSelector"/>
<object-type name="QIODevice">
<enum-type name="OpenModeFlag" flags="OpenMode"/>
@@ -3044,10 +2492,13 @@
<remove-default-expression />
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="fix_char*" />
+ <insert-template name="fix_char*"/>
</inject-code>
</modify-function>
<modify-function signature="readData(char*,qint64)">
+ <!-- placing this injected code in the snippet files breaks the
+ propagation of this method to the QAbstractSocket and QLocalSocket
+ classes -->
<inject-code class="target">
QByteArray ba(1 + int(%2), char(0));
%CPPSELF.%FUNCTION_NAME(ba.data(), int(%2));
@@ -3071,6 +2522,9 @@
</modify-argument>
</modify-function>
<modify-function signature="readLineData(char*,qint64)">
+ <!-- placing this injected code in the snippet files breaks the
+ propagation of this method to the QAbstractSocket and QLocalSocket
+ classes -->
<inject-code class="target">
QByteArray ba(1 + int(%2), char(0));
%CPPSELF.%FUNCTION_NAME(ba.data(), int(%2));
@@ -3100,9 +2554,7 @@
<modify-argument index="2">
<remove-argument />
</modify-argument>
- <inject-code>
- %CPPSELF.%FUNCTION_NAME(Shiboken::String::toCString(%PYARG_1), Shiboken::String::len(%PYARG_1));
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qcryptographichash-adddata"/>
</modify-function>
</object-type>
<value-type name="QOperatingSystemVersion" since="5.9">
@@ -3123,11 +2575,9 @@
<reference-count action="set"/>
</modify-argument>
</modify-function>
- <add-function signature="__enter__()" />
+ <add-function signature="__enter__()"/>
<add-function signature="__exit__(PyObject*,PyObject*,PyObject*)">
- <inject-code>
- %CPPSELF.unlock();
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="unlock"/>
</add-function>
</object-type>
@@ -3143,7 +2593,7 @@
<modify-function signature="tryLock(int)" allow-thread="yes"/>
</object-type>
<object-type name="QRandomGenerator" since="5.10">
- <modify-function signature="global()" rename="global_" allow-thread="yes" />
+ <modify-function signature="global()" rename="global_" allow-thread="yes"/>
<modify-function signature="operator()()" remove="all"/>
</object-type>
<object-type name="QRandomGenerator64" since="5.10">
@@ -3159,25 +2609,10 @@
<enum-type name="Type"/>
<add-function signature="QSocketNotifier(PyObject*, QSocketNotifier::Type, QObject*)">
<modify-argument index="3">
- <replace-default-expression with="0" />
- <rename to="parent" />
+ <replace-default-expression with="0"/>
+ <rename to="parent"/>
</modify-argument>
- <inject-code>
- Shiboken::AutoDecRef socket(%PYARG_1);
- if (!socket.isNull()) {
- // We use qintptr as PyLong, but we check for int
- // since it is currently an alias to be Python2 compatible.
- // Internally, ints are qlonglongs.
- if (%CHECKTYPE[int](socket)) {
- int cppSocket = %CONVERTTOCPP[int](socket);
- qintptr socket = (qintptr)cppSocket;
- %0 = new %TYPE(socket, %2, %3);
- } else {
- PyErr_SetString(PyExc_TypeError,
- "QSocketNotifier: first argument (socket) must be an int.");
- }
- }
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qsocketnotifier"/>
</add-function>
</object-type>
@@ -3212,19 +2647,19 @@
</modify-argument>
</modify-function>
<!-- fromUnicode(QString) does the job -->
- <modify-function signature="fromUnicode(const QChar*,int,QTextCodec::ConverterState*)const" remove="all" />
- <modify-function signature="convertFromUnicode(const QChar*,int,QTextCodec::ConverterState*)const" remove="all" />
+ <modify-function signature="fromUnicode(const QChar*,int,QTextCodec::ConverterState*)const" remove="all"/>
+ <modify-function signature="convertFromUnicode(const QChar*,int,QTextCodec::ConverterState*)const" remove="all"/>
<!-- this causes a warning that I cannot avoid. See suppressed warning at the end. -->
</object-type>
<object-type name="QTextDecoder">
<!-- ### toUnicode(QByteArray) does the job -->
- <modify-function signature="toUnicode(const char*,int)" remove="all" />
- <modify-function signature="toUnicode(QString*,const char*,int)" remove="all" />
+ <modify-function signature="toUnicode(const char*,int)" remove="all"/>
+ <modify-function signature="toUnicode(QString*,const char*,int)" remove="all"/>
<!-- ### -->
</object-type>
<object-type name="QTextEncoder">
<!-- fromUnicode(QString) does the job -->
- <modify-function signature="fromUnicode(const QChar*,int)" remove="all" />
+ <modify-function signature="fromUnicode(const QChar*,int)" remove="all"/>
</object-type>
<object-type name="QTimeLine">
<enum-type name="CurveShape"/>
@@ -3234,17 +2669,12 @@
<object-type name="QTranslator">
<modify-function signature="load(const uchar*,int,QString)">
<modify-argument index="1">
- <replace-type modified-type="PyBuffer" />
+ <replace-type modified-type="PyBuffer"/>
</modify-argument>
<modify-argument index="2">
<remove-argument />
</modify-argument>
- <inject-code>
- Py_ssize_t size;
- uchar *ptr = reinterpret_cast&lt;uchar*&gt;(Shiboken::Buffer::getPointer(%PYARG_1, &amp;size));
- %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(const_cast&lt;const uchar*&gt;(ptr), size);
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qtranslator-load"/>
</modify-function>
</object-type>
<object-type name="QWaitCondition">
@@ -3264,67 +2694,10 @@
</object-type>
<object-type name="QTimer">
<modify-function signature="singleShot(int,const QObject*,const char*)">
- <inject-code class="target" position="beginning">
- // %FUNCTION_NAME() - disable generation of c++ function call
- (void) %2; // remove warning about unused variable
- Shiboken::AutoDecRef emptyTuple(PyTuple_New(0));
- PyObject *pyTimer = reinterpret_cast&lt;PyTypeObject *&gt;(Shiboken::SbkType&lt;QTimer&gt;())->tp_new(Shiboken::SbkType&lt;QTimer&gt;(), emptyTuple, 0);
- reinterpret_cast&lt;PyTypeObject *&gt;(Shiboken::SbkType&lt;QTimer&gt;())->tp_init(pyTimer, emptyTuple, 0);
-
- QTimer* timer = %CONVERTTOCPP[QTimer*](pyTimer);
- Shiboken::AutoDecRef result(
- PyObject_CallMethod(pyTimer,
- const_cast&lt;char*&gt;("connect"),
- const_cast&lt;char*&gt;("OsOs"),
- pyTimer,
- SIGNAL(timeout()),
- %PYARG_2,
- %3)
- );
- Shiboken::Object::releaseOwnership((SbkObject*)pyTimer);
- Py_XDECREF(pyTimer);
- timer->setSingleShot(true);
- timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));
- timer->start(%1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qtimer-singleshot-1"/>
</modify-function>
<add-function signature="singleShot(int,PyCallable*)" static="yes">
- <inject-code class="target" position="beginning">
- // %FUNCTION_NAME() - disable generation of c++ function call
- Shiboken::AutoDecRef emptyTuple(PyTuple_New(0));
- PyObject *pyTimer = reinterpret_cast&lt;PyTypeObject *&gt;(Shiboken::SbkType&lt;QTimer&gt;())->tp_new(Shiboken::SbkType&lt;QTimer&gt;(), emptyTuple, 0);
- reinterpret_cast&lt;PyTypeObject *&gt;(Shiboken::SbkType&lt;QTimer&gt;())->tp_init(pyTimer, emptyTuple, 0);
- QTimer* timer = %CONVERTTOCPP[QTimer*](pyTimer);
- timer->setSingleShot(true);
-
- if (PyObject_TypeCheck(%2, PySideSignalInstanceTypeF())) {
- PySideSignalInstance *signalInstance = reinterpret_cast&lt;PySideSignalInstance*&gt;(%2);
- Shiboken::AutoDecRef signalSignature(Shiboken::String::fromFormat("2%s", PySide::Signal::getSignature(signalInstance)));
- Shiboken::AutoDecRef result(
- PyObject_CallMethod(pyTimer,
- const_cast&lt;char*&gt;("connect"),
- const_cast&lt;char*&gt;("OsOO"),
- pyTimer,
- SIGNAL(timeout()),
- PySide::Signal::getObject(signalInstance),
- signalSignature.object())
- );
- } else {
- Shiboken::AutoDecRef result(
- PyObject_CallMethod(pyTimer,
- const_cast&lt;char*&gt;("connect"),
- const_cast&lt;char*&gt;("OsO"),
- pyTimer,
- SIGNAL(timeout()),
- %PYARG_2)
- );
- }
-
- timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()), Qt::DirectConnection);
- Shiboken::Object::releaseOwnership((SbkObject*)pyTimer);
- Py_XDECREF(pyTimer);
- timer->start(%1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qtimer-singleshot-2"/>
</add-function>
</object-type>
<object-type name="QProcess">
@@ -3349,37 +2722,22 @@
<modify-argument index="return">
<replace-type modified-type="(retval, pid)"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- qint64 pid;
- %RETURN_TYPE retval = %TYPE::%FUNCTION_NAME(%1, %2, %3, &amp;pid);
- %PYARG_0 = PyTuple_New(2);
- PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval));
- PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[qint64](pid));
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qprocess-startdetached"/>
</modify-function>
<!-- Function removed because on windows it returns a win32 specific structure -->
- <modify-function signature="pid()const" remove="all" />
+ <modify-function signature="pid()const" remove="all"/>
<add-function signature="pid()" return-type="long">
- <inject-code>
- long result;
- #ifdef WIN32
- _PROCESS_INFORMATION *procInfo = %CPPSELF.%FUNCTION_NAME();
- result = procInfo ? procInfo->dwProcessId : 0;
- #else
- result = %CPPSELF.%FUNCTION_NAME();
- #endif
- %PYARG_0 = %CONVERTTOPYTHON[long](result);
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qprocess-pid"/>
</add-function>
<!--### Obsolete in 4.3-->
<modify-function signature="setReadChannelMode(QProcess::ProcessChannelMode)" remove="all"/>
<modify-function signature="readChannelMode()const" remove="all"/>
<!-- ### -->
</object-type>
- <object-type name="QSignalMapper" />
+ <object-type name="QSignalMapper"/>
- <object-type name="QCollatorSortKey" since="5.2" />
- <object-type name="QCollator" since="5.2" />
+ <object-type name="QCollatorSortKey" since="5.2"/>
+ <object-type name="QCollator" since="5.2"/>
<object-type name="QCommandLineOption" since="5.2">
<enum-type name="Flag" flags="Flags" since="5.8"/>
@@ -3390,7 +2748,7 @@
</object-type>
<object-type name="QCoreApplication">
- <!--Qt5: gone <enum-type name="Encoding" /> -->
+ <!--Qt5: gone <enum-type name="Encoding"/> -->
<enum-type identified-by-value="ApplicationFlags" since="4.8" revision="4800"/>
<extra-includes>
<include file-name="QStringList" location="global"/>
@@ -3409,17 +2767,10 @@
method.
</inject-documentation>
<add-function signature="QCoreApplication(QStringList)">
- <inject-code>
- QCoreApplicationConstructor(%PYSELF, args, &amp;%0);
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qcoreapplication-1"/>
</add-function>
<add-function signature="QCoreApplication()">
- <inject-code>
- PyObject *empty = PyTuple_New(2);
- if (!PyTuple_SetItem(empty, 0, PyList_New(0))) {
- QCoreApplicationConstructor(%PYSELF, empty, &amp;%0);
- }
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qcoreapplication-2"/>
</add-function>
<!-- blocking functions -->
<modify-function signature="processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;,int)" allow-thread="yes"/>
@@ -3428,22 +2779,7 @@
<modify-function signature="sendEvent(QObject*,QEvent*)" allow-thread="yes"/>
<modify-function signature="sendPostedEvents(QObject*,int)" allow-thread="yes"/>
<modify-function signature="instance()">
- <inject-code class="target">
- QCoreApplication *app = QCoreApplication::instance();
- PyObject *pyApp = Py_None;
- if (app) {
- pyApp = reinterpret_cast&lt;PyObject*&gt;(
- Shiboken::BindingManager::instance().retrieveWrapper(app));
- if (!pyApp)
- pyApp = %CONVERTTOPYTHON[QCoreApplication*](app);
- // this will keep app live after python exit (extra ref)
- }
- // PYSIDE-571: make sure that we return the singleton "None"
- if (pyApp == Py_None)
- Py_DECREF(MakeSingletonQAppWrapper(0)); // here qApp and instance() diverge
- %PYARG_0 = pyApp;
- Py_XINCREF(%PYARG_0);
- </inject-code>
+ <inject-code class="target" file="../glue/qtcore.cpp" snippet="qcoreapplication-instance"/>
</modify-function>
<modify-function signature="exec()" rename="exec_" allow-thread="yes"/>
@@ -3451,7 +2787,7 @@
<modify-argument index="2" invalidate-after-use="yes"/>
</modify-function>
<modify-function signature="QCoreApplication(int &amp;,char **,int)" access="private"/>
- <inject-code class="native" file="glue/qcoreapplication_init.cpp" position="beginning" />
+ <inject-code class="native" file="glue/qcoreapplication_init.cpp" position="beginning"/>
<modify-function signature="postEvent(QObject*,QEvent*,int)">
<modify-argument index="2">
<define-ownership owner="c++"/>
@@ -3490,8 +2826,8 @@
</modify-argument>
</modify-function>
</object-type>
- <object-type name="QTimerEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Timer" />
- <object-type name="QDynamicPropertyChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DynamicPropertyChange" />
+ <object-type name="QTimerEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Timer"/>
+ <object-type name="QDynamicPropertyChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DynamicPropertyChange"/>
<template name="stream_read_method">
%RETURN_TYPE _cpp_result;
@@ -3596,26 +2932,13 @@
<modify-argument index="1">
<remove-argument />
</modify-argument>
- <inject-code class="target">
- QByteArray data;
- data.resize(%2);
- int result = %CPPSELF.%FUNCTION_NAME(data.data(), data.size());
- if (result == -1) {
- Py_INCREF(Py_None);
- %PYARG_0 = Py_None;
- } else {
- %PYARG_0 = PyBytes_FromStringAndSize(data.data(), result);
- }
- </inject-code>
+ <inject-code class="target" file="../glue/qtcore.cpp" snippet="qdatastream-readrawdata"/>
</modify-function>
<modify-function signature="writeRawData(const char*,int)">
<modify-argument index="2">
<remove-argument />
</modify-argument>
- <inject-code class="target">
- int r = %CPPSELF.%FUNCTION_NAME(%1, Shiboken::String::len(%PYARG_1));
- %PYARG_0 = %CONVERTTOPYTHON[int](r);
- </inject-code>
+ <inject-code class="target" file="../glue/qtcore.cpp" snippet="qdatastream-writerawdata"/>
</modify-function>
<!-- Extra functions for primitive type handling -->
@@ -3743,7 +3066,7 @@
<!-- ### deprecated method -->
<modify-function signature="readBytes(char*&amp;,uint&amp;)" remove="all"/>
- <modify-function signature="writeBytes(const char*,uint)" remove="all" />
+ <modify-function signature="writeBytes(const char*,uint)" remove="all"/>
</object-type>
<value-type name="QTextStreamManipulator" default-constructor="QTextStreamManipulator(0, 0)">
@@ -3793,7 +3116,7 @@
<modify-function signature="string()const">
<modify-argument index="return">
- <!--<replace-type modified-type="QString" />-->
+ <!--<replace-type modified-type="QString"/>-->
<conversion-rule class="target">
QString &amp;res = *%0;
%PYARG_0 = %CONVERTTOPYTHON[QString](res);
@@ -3818,19 +3141,17 @@
<object-type name="QThreadPool">
<modify-function signature="start(QRunnable*,int)">
<modify-argument index="1">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="tryStart(QRunnable*)">
<modify-argument index="1">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="globalInstance()" >
- <inject-code position="end">
- Shiboken::Object::releaseOwnership(%PYARG_0);
- </inject-code>
+ <inject-code position="end" file="../glue/qtcore.cpp" snippet="releaseownership"/>
</modify-function>
</object-type>
<value-type name="QXmlStreamAttribute"/>
@@ -3841,7 +3162,7 @@
<modify-function signature="pop_front()" remove="all"/>
<modify-function signature="toList()const" remove="all"/>
<modify-function signature="fromList(const QList&lt;QXmlStreamAttribute&gt; &amp;)" remove="all"/>
- <modify-function signature="operator+=(QVector&lt;QXmlStreamAttribute&gt;)" remove="all" />
+ <modify-function signature="operator+=(QVector&lt;QXmlStreamAttribute&gt;)" remove="all"/>
</value-type>
<value-type name="QXmlStreamNamespaceDeclaration"/>
<value-type name="QXmlStreamNotationDeclaration"/>
@@ -3853,7 +3174,7 @@
</object-type>
<object-type name="QXmlStreamWriter">
<!-- Removed because it expect QString to be mutable -->
- <modify-function signature="QXmlStreamWriter(QString*)" remove="all" />
+ <modify-function signature="QXmlStreamWriter(QString*)" remove="all"/>
<modify-function signature="codec()const">
<modify-argument index="return">
<define-ownership class="target" owner="default"/>
@@ -3869,40 +3190,40 @@
</value-type>
<value-type name="QGenericArgument">
- <include file-name="qobjectdefs.h" location="global" />
+ <include file-name="qobjectdefs.h" location="global"/>
</value-type>
<value-type name="QGenericReturnArgument">
- <include file-name="qobjectdefs.h" location="global" />
+ <include file-name="qobjectdefs.h" location="global"/>
</value-type>
<object-type name="QMessageLogContext">
- <modify-function signature="copy(const QMessageLogContext &amp;)" remove="all" />
+ <modify-function signature="copy(const QMessageLogContext &amp;)" remove="all"/>
</object-type>
<value-type name="QMetaMethod">
<enum-type name="Access"/>
<enum-type name="MethodType"/>
<!-- This isn't part of Qt public API -->
- <modify-function signature="attributes()const" remove="all" />
- <modify-function signature="getParameterTypes(int*)const" remove="all" />
+ <modify-function signature="attributes()const" remove="all"/>
+ <modify-function signature="getParameterTypes(int*)const" remove="all"/>
</value-type>
<object-type name="QMetaObject">
<enum-type name="Call"/>
- <include file-name="qobjectdefs.h" location="global" />
+ <include file-name="qobjectdefs.h" location="global"/>
<!-- This isn't part of Qt public API -->
- <modify-function signature="connect(const QObject*,int,const QObject*,int,int,int*)" remove="all" />
+ <modify-function signature="connect(const QObject*,int,const QObject*,int,int,int*)" remove="all"/>
</object-type>
<object-type name="QMetaObject::Connection">
- <include file-name="qobjectdefs.h" location="global" />
+ <include file-name="qobjectdefs.h" location="global"/>
</object-type>
<value-type name="QMetaProperty" >
<!-- This isn't part of Qt public API -->
- <modify-function signature="enclosingMetaObject()const" remove="all" />
+ <modify-function signature="enclosingMetaObject()const" remove="all"/>
</value-type>
<value-type name="QMetaClassInfo">
<!-- This isn't part of Qt public API -->
- <modify-function signature="enclosingMetaObject()const" remove="all" />
+ <modify-function signature="enclosingMetaObject()const" remove="all"/>
</value-type>
<value-type name="QMetaEnum">
@@ -3911,7 +3232,7 @@
<remove-argument />
</modify-argument>
<modify-argument index="return">
- <replace-type modified-type="PyTuple" />
+ <replace-type modified-type="PyTuple"/>
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_args,bool*"/>
@@ -3922,14 +3243,14 @@
<remove-argument />
</modify-argument>
<modify-argument index="return">
- <replace-type modified-type="PyTuple" />
+ <replace-type modified-type="PyTuple"/>
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
<!-- This isn't part of Qt public API -->
- <modify-function signature="enclosingMetaObject()const" remove="all" />
+ <modify-function signature="enclosingMetaObject()const" remove="all"/>
</value-type>
<!-- From Qt4.6 -->
@@ -3948,7 +3269,7 @@
</object-type>
<object-type name="QAbstractTransition" since="4.6">
- <enum-type name="TransitionType" since="5.5" />
+ <enum-type name="TransitionType" since="5.5"/>
<modify-function signature="QAbstractTransition(QState*)">
<modify-argument index="1">
@@ -3976,19 +3297,19 @@
<modify-function signature="targetState()const">
<modify-argument index="return">
- <reference-count action="set" variable-name="setTargetState(QAbstractState*)1" />
+ <reference-count action="set" variable-name="setTargetState(QAbstractState*)1"/>
</modify-argument>
</modify-function>
<modify-function signature="targetStates()const">
<modify-argument index="return">
- <reference-count action="set" variable-name="setTargetState(QAbstractState*)1" />
+ <reference-count action="set" variable-name="setTargetState(QAbstractState*)1"/>
</modify-argument>
</modify-function>
<modify-function signature="setTargetStates(QList&lt;QAbstractState*&gt;)">
<modify-argument index="1">
- <reference-count action="set" variable-name="setTargetState(QAbstractState*)1" />
+ <reference-count action="set" variable-name="setTargetState(QAbstractState*)1"/>
</modify-argument>
</modify-function>
@@ -4020,42 +3341,25 @@
</modify-function>
<modify-function signature="clear()" >
- <inject-code class="target" position="beginning">
- for (int counter = 0; counter &lt; %CPPSELF.animationCount(); ++counter ) {
- QAbstractAnimation *animation = %CPPSELF.animationAt(counter);
- PyObject *obj = %CONVERTTOPYTHON[QAbstractAnimation*](animation);
- Shiboken::Object::setParent(NULL, obj);
- Py_DECREF(obj);
- }
- %CPPSELF.clear();
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qanimationgroup-clear"/>
</modify-function>
</object-type>
<!-- We will use inject code to implement the function below -->
- <rejection class="QEasingCurve" function-name="setCustomType" />
- <rejection class="QEasingCurve" function-name="customType" />
+ <rejection class="QEasingCurve" function-name="setCustomType"/>
+ <rejection class="QEasingCurve" function-name="customType"/>
<value-type name="QEasingCurve" since="4.6">
<extra-includes>
<include file-name="pysideweakref.h" location="global"/>
<include file-name="glue/qeasingcurve_glue.h" location="local"/>
</extra-includes>
- <inject-code>
- PySideEasingCurveFunctor::init();
- </inject-code>
- <enum-type name="Type" />
+ <inject-code file="../glue/qtcore.cpp" snippet="qeasingcurve"/>
+ <enum-type name="Type"/>
<add-function signature="setCustomType(PyObject*)">
- <inject-code>
- QEasingCurve::EasingFunction func = PySideEasingCurveFunctor::createCustomFuntion(%PYSELF, %PYARG_1);
- if (func)
- %CPPSELF.%FUNCTION_NAME(func);
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qeasingcurve-setcustomtype"/>
</add-function>
<add-function signature="customType()" return-type="PyObject">
- <inject-code>
- //%FUNCTION_NAME()
- %PYARG_0 = PySideEasingCurveFunctor::callable(%PYSELF);
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qeasingcurve-customtype"/>
</add-function>
</value-type>
@@ -4066,11 +3370,11 @@
</value-type>
<value-type name="QJsonDocument">
- <enum-type name="DataValidation" />
- <enum-type name="JsonFormat" />
+ <enum-type name="DataValidation"/>
+ <enum-type name="JsonFormat"/>
</value-type>
- <rejection class="QJsonDocument" field-name="BinaryFormatTag" />
+ <rejection class="QJsonDocument" field-name="BinaryFormatTag"/>
<value-type name="QJsonParseError">
<enum-type name="ParseError"/>
@@ -4100,10 +3404,10 @@
</object-type>
- <object-type name="QFinalState" since="4.6" />
+ <object-type name="QFinalState" since="4.6"/>
<object-type name="QHistoryState" since="4.6">
- <enum-type name="HistoryType" />
+ <enum-type name="HistoryType"/>
<modify-documentation xpath='description/code'>
&lt;code>machine = QStateMachine()
@@ -4143,20 +3447,9 @@ s1.addTransition(button.clicked, s1h)&lt;/code>
<object-type name="QSignalTransition" since="4.6">
<add-function signature="QSignalTransition(PyObject*,QState*)" return-type="QSignalTransition*">
<modify-argument index="2">
- <replace-default-expression with="0" />
+ <replace-default-expression with="0"/>
</modify-argument>
- <inject-code>
- if (PyObject_TypeCheck(%1, PySideSignalInstanceTypeF())) {
- PyObject *dataSource = PySide::Signal::getObject((PySideSignalInstance*)%PYARG_1);
- Shiboken::AutoDecRef obType(PyObject_Type(dataSource));
- QObject* sender = %CONVERTTOCPP[QObject*](dataSource);
- if (sender) {
- const char*dataSignature = PySide::Signal::getSignature((PySideSignalInstance*)%PYARG_1);
- QByteArray signature(dataSignature); // Append SIGNAL flag (2)
- %0 = new QSignalTransitionWrapper(sender,"2" + signature,%2);
- }
- }
- </inject-code>
+ <inject-code file="../glue/qtcore.cpp" snippet="qsignaltransition"/>
</add-function>
</object-type>
@@ -4173,16 +3466,7 @@ s1.addTransition(button.clicked, s1h)&lt;/code>
<modify-argument index="return">
<parent index="this" action="add"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- QString signalName(%2);
- if (PySide::SignalManager::registerMetaMethod(%1, signalName.mid(1).toLatin1().data(), QMetaMethod::Signal)) {
- QSignalTransition *%0 = %CPPSELF->addTransition(%1, %2, %3);
- %PYARG_0 = %CONVERTTOPYTHON[QSignalTransition*](%0);
- } else {
- Py_INCREF(Py_None);
- %PYARG_0 = Py_None;
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qstate-addtransition-1"/>
</modify-function>
<modify-function signature="addTransition(QAbstractState*)">
<modify-argument index="1">
@@ -4197,18 +3481,7 @@ s1.addTransition(button.clicked, s1h)&lt;/code>
<modify-argument index="return">
<parent index="this" action="add"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- // Obviously the label used by the following goto is a very awkward solution,
- // since it refers to a name very tied to the generator implementation.
- // Check bug #362 for more information on this
- // http://bugs.openbossa.org/show_bug.cgi?id=362
- if (!PyObject_TypeCheck(%1, PySideSignalInstanceTypeF()))
- goto Sbk_%TYPEFunc_%FUNCTION_NAME_TypeError;
- PySideSignalInstance *signalInstance = reinterpret_cast&lt;PySideSignalInstance*&gt;(%1);
- QObject* sender = %CONVERTTOCPP[QObject*](PySide::Signal::getObject(signalInstance));
- QSignalTransition *%0 = %CPPSELF->%FUNCTION_NAME(sender, PySide::Signal::getSignature(signalInstance),%2);
- %PYARG_0 = %CONVERTTOPYTHON[QSignalTransition*](%0);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qstate-addtransition-2"/>
</add-function>
<modify-function signature="removeTransition(QAbstractTransition*)">
@@ -4237,27 +3510,13 @@ s1.addTransition(button.clicked, s1h)&lt;/code>
</modify-function>
<add-function signature="configuration()" return-type="list of QAbstractState" >
- <inject-code class="target" position="beginning">
- %PYARG_0 = PySet_New(0);
- foreach(QAbstractState *abs_state, %CPPSELF.configuration()) {
- Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractState*](abs_state));
- Shiboken::Object::setParent(self, obj);
- PySet_Add(%PYARG_0, obj);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qstatemachine-configuration"/>
</add-function>
<!-- Replaced by a added function -->
<modify-function signature="defaultAnimations()const" remove="all"/>
<add-function signature="defaultAnimations()" return-type="list of QAbstractAnimation" >
- <inject-code class="target" position="beginning">
- %PYARG_0 = PyList_New(0);
- foreach(QAbstractAnimation *abs_anim, %CPPSELF.defaultAnimations()) {
- Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractAnimation*](abs_anim));
- Shiboken::Object::setParent(self, obj);
- PyList_Append(%PYARG_0, obj);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qstatemachine-defaultanimations"/>
</add-function>
</object-type>
@@ -4274,73 +3533,45 @@ s1.addTransition(button.clicked, s1h)&lt;/code>
<!-- From Qt4.6 ^^^ -->
<add-function signature="SIGNAL(const char*)" return-type="str">
- <inject-code class="target" position="beginning">
- %PYARG_0 = Shiboken::String::fromFormat("2%s",QMetaObject::normalizedSignature(%1).constData());
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qt-signal"/>
</add-function>
<add-function signature="SLOT(const char*)" return-type="str">
- <inject-code class="target" position="beginning">
- %PYARG_0 = Shiboken::String::fromFormat("1%s",QMetaObject::normalizedSignature(%1).constData());
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qt-slot"/>
</add-function>
<add-function signature="QT_TR_NOOP(PyObject)" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="return_argument"><replace from="#" to="1" /></insert-template>
+ <insert-template name="return_argument"><replace from="#" to="1"/></insert-template>
</inject-code>
</add-function>
<add-function signature="QT_TR_NOOP_UTF8(PyObject)" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="return_argument"><replace from="#" to="1" /></insert-template>
+ <insert-template name="return_argument"><replace from="#" to="1"/></insert-template>
</inject-code>
</add-function>
<add-function signature="QT_TRANSLATE_NOOP(PyObject,PyObject)" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="return_argument"><replace from="#" to="2" /></insert-template>
+ <insert-template name="return_argument"><replace from="#" to="2"/></insert-template>
</inject-code>
</add-function>
<add-function signature="QT_TRANSLATE_NOOP3(PyObject,PyObject,PyObject)" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="return_argument"><replace from="#" to="2" /></insert-template>
+ <insert-template name="return_argument"><replace from="#" to="2"/></insert-template>
</inject-code>
</add-function>
<add-function signature="QT_TRANSLATE_NOOP_UTF8(PyObject)" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="return_argument"><replace from="#" to="1" /></insert-template>
+ <insert-template name="return_argument"><replace from="#" to="1"/></insert-template>
</inject-code>
</add-function>
- <inject-code class="native" position="beginning">
- QT_BEGIN_NAMESPACE
- extern bool
- qRegisterResourceData(int,
- const unsigned char *,
- const unsigned char *,
- const unsigned char *);
-
- extern bool
- qUnregisterResourceData(int,
- const unsigned char *,
- const unsigned char *,
- const unsigned char *);
- QT_END_NAMESPACE
- </inject-code>
+ <inject-code class="native" position="beginning" file="../glue/qtcore.cpp" snippet="qt-registerresourcedata"/>
<add-function signature="qRegisterResourceData(int,PyBytes,PyBytes,PyBytes)" return-type="bool">
- <inject-code class="target" position="beginning">
- %RETURN_TYPE %0 = %FUNCTION_NAME(%1, reinterpret_cast&lt;uchar*&gt;(PyBytes_AS_STRING(%PYARG_2)),
- reinterpret_cast&lt;uchar*&gt;(PyBytes_AS_STRING(%PYARG_3)),
- reinterpret_cast&lt;uchar*&gt;(PyBytes_AS_STRING(%PYARG_4)));
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qt-qregisterresourcedata"/>
</add-function>
<add-function signature="qUnregisterResourceData(int,PyBytes,PyBytes,PyBytes)" return-type="bool">
- <inject-code class="target" position="beginning">
- %RETURN_TYPE %0 = %FUNCTION_NAME(%1, reinterpret_cast&lt;uchar*&gt;(PyBytes_AS_STRING(%PYARG_2)),
- reinterpret_cast&lt;uchar*&gt;(PyBytes_AS_STRING(%PYARG_3)),
- reinterpret_cast&lt;uchar*&gt;(PyBytes_AS_STRING(%PYARG_4)));
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qt-qunregisterresourcedata"/>
</add-function>
<object-type name="QFactoryInterface"/>
@@ -4349,9 +3580,9 @@ s1.addTransition(button.clicked, s1h)&lt;/code>
<object-type name="QPluginLoader"/>
<object-type name="QStringListModel"/>
- <suppress-warning text="Unable to decide type of property: 'QLibrary::LoadHints' in class 'QPluginLoader'" />
- <suppress-warning text="enum '_ISalnum' does not have a type entry or is not an enum" />
- <suppress-warning text="enum 'Qt::Initialization' does not have a type entry or is not an enum" />
+ <suppress-warning text="Unable to decide type of property: 'QLibrary::LoadHints' in class 'QPluginLoader'"/>
+ <suppress-warning text="enum '_ISalnum' does not have a type entry or is not an enum"/>
+ <suppress-warning text="enum 'Qt::Initialization' does not have a type entry or is not an enum"/>
<suppress-warning text="visibility of function '*' modified in class '*'"/>
<suppress-warning text="hiding of function '*' in class '*'"/>
<suppress-warning text="namespace '*' does not have a type entry"/>
@@ -4371,15 +3602,15 @@ s1.addTransition(button.clicked, s1h)&lt;/code>
<suppress-warning text="unmatched enum ~0u"/>
<suppress-warning text="unmatched enum (sizeof(void*)&lt;&lt;3)"/>
<suppress-warning text="^signature 'setCustomType(float)' for function modification in 'QEasingCurve' not found.*$"/>
- <suppress-warning text="enum 'enum_4' does not have a type entry or is not an enum" />
- <suppress-warning text="enum 'enum_5' does not have a type entry or is not an enum" />
- <suppress-warning text="enum 'FP_NORMAL' does not have a type entry or is not an enum" />
- <suppress-warning text="Shadowing: *" />
+ <suppress-warning text="enum 'enum_4' does not have a type entry or is not an enum"/>
+ <suppress-warning text="enum 'enum_5' does not have a type entry or is not an enum"/>
+ <suppress-warning text="enum 'FP_NORMAL' does not have a type entry or is not an enum"/>
+ <suppress-warning text="Shadowing: *"/>
<!-- QCborStreamReader: Suppress warnings about 32/64bit signatures not found depending on qsizetype -->
<suppress-warning text="^signature 'readStringChunk\(char.*in 'QCborStreamReader' not found.*$"/>
<!-- this enum is defined on Qt global header but only used in QtGui module -->
- <suppress-warning text="enum 'PM_MessageBoxHeight' does not have a type entry or is not an enum" />
+ <suppress-warning text="enum 'PM_MessageBoxHeight' does not have a type entry or is not an enum"/>
<!-- this function only exists on Windows -->
<suppress-warning text="^signature 'winEventFilter(MSG*,long*)' for function modification in 'QCoreApplication' not found.*"/>
@@ -4389,7 +3620,7 @@ s1.addTransition(button.clicked, s1h)&lt;/code>
<suppress-warning text="^signature 'operator+(QByteArray,QString)' for function modification in 'QByteArray' not found.*"/>
<!-- This enum is intenaly used -->
- <suppress-warning text="enum 'PM_CbaIconHeight' does not have a type entry or is not an enum" />
+ <suppress-warning text="enum 'PM_CbaIconHeight' does not have a type entry or is not an enum"/>
<!-- TODO: this need be removed -->
<suppress-warning text="^skipping function '.*', unmatched return type '.*$"/>
@@ -4397,30 +3628,30 @@ s1.addTransition(button.clicked, s1h)&lt;/code>
<suppress-warning text="enum 'q_static_assert_result39' does not have a type entry or is not an enum"/>
<suppress-warning text="horribly broken type ''"/>
- <suppress-warning text="Pure virtual method 'QTextCodec::convertFromUnicode(const QChar*,int,QTextCodec::ConverterState*)const' must be implement but was completely removed on type system." />
+ <suppress-warning text="Pure virtual method 'QTextCodec::convertFromUnicode(const QChar*,int,QTextCodec::ConverterState*)const' must be implement but was completely removed on type system."/>
<!-- Qt5.5: No idea how to get rid of the following five enums, which are moved elsewhere since 5.5: -->
- <suppress-warning text="enum 'QLocale::MeasurementSystem' is specified in typesystem, but not declared" />
- <suppress-warning text="enum 'QState::RestorePolicy' is specified in typesystem, but not declared" />
- <!-- <suppress-warning text="enum 'QLocale::FormatType' is specified in typesystem, but not declared" /> -->
- <suppress-warning text="enum 'QAbstractAnimation::DeletionPolicy' is specified in typesystem, but not declared" />
- <!-- <suppress-warning text="enum 'QAbstractAnimation::State' is specified in typesystem, but not declared" /> -->
+ <suppress-warning text="enum 'QLocale::MeasurementSystem' is specified in typesystem, but not declared"/>
+ <suppress-warning text="enum 'QState::RestorePolicy' is specified in typesystem, but not declared"/>
+ <!-- <suppress-warning text="enum 'QLocale::FormatType' is specified in typesystem, but not declared"/> -->
+ <suppress-warning text="enum 'QAbstractAnimation::DeletionPolicy' is specified in typesystem, but not declared"/>
+ <!-- <suppress-warning text="enum 'QAbstractAnimation::State' is specified in typesystem, but not declared"/> -->
<!-- Qt5.5: we also suppress these warnings, instead of adding wrong enums -->
- <suppress-warning text="enum 'InterfaceType' does not have a type entry or is not an enum" />
- <suppress-warning text="enum 'TextBoundaryType' does not have a type entry or is not an enum" />
- <suppress-warning text="enum 'RelationFlag' does not have a type entry or is not an enum" />
- <suppress-warning text="enum 'Role' does not have a type entry or is not an enum" />
+ <suppress-warning text="enum 'InterfaceType' does not have a type entry or is not an enum"/>
+ <suppress-warning text="enum 'TextBoundaryType' does not have a type entry or is not an enum"/>
+ <suppress-warning text="enum 'RelationFlag' does not have a type entry or is not an enum"/>
+ <suppress-warning text="enum 'Role' does not have a type entry or is not an enum"/>
<!-- Anonymous enum in qtbase/src/corelib/global/qtypeinfo.h -->
<suppress-warning text="Anonymous enum (Q_COMPLEX_TYPE, ... , Q_RELOCATABLE_TYPE) does not have a type entry"/>
<!-- Another anonymous enum / value pair in in qtbase/src/corelib/kernel/qcoreapplication.h -->
- <suppress-warning text="no matching enum 'QT_VERSION'" />
- <suppress-warning text="unhandled enum value: QT_VERSION in QCoreApplication::ApplicationFlags from header 'qcoreapplication.h'" />
- <suppress-warning text="unmatched enum QT_VERSION from header 'qcoreapplication.h'" />
+ <suppress-warning text="no matching enum 'QT_VERSION'"/>
+ <suppress-warning text="unhandled enum value: QT_VERSION in QCoreApplication::ApplicationFlags from header 'qcoreapplication.h'"/>
+ <suppress-warning text="unmatched enum QT_VERSION from header 'qcoreapplication.h'"/>
- <suppress-warning text="skipping field 'QSysInfo::WindowsVersion' with unmatched type 'const QSysInfo::WinVersion'" />
- <suppress-warning text="template baseclass 'QListSpecialMethods&lt;T&gt;' of 'QList' is not known" />
+ <suppress-warning text="skipping field 'QSysInfo::WindowsVersion' with unmatched type 'const QSysInfo::WinVersion'"/>
+ <suppress-warning text="template baseclass 'QListSpecialMethods&lt;T&gt;' of 'QList' is not known"/>
</typesystem>
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_mac.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_mac.xml
index 583c1c08e..c1a1abcb3 100644
--- a/sources/pyside2/PySide2/QtCore/typesystem_core_mac.xml
+++ b/sources/pyside2/PySide2/QtCore/typesystem_core_mac.xml
@@ -40,7 +40,7 @@
****************************************************************************/
-->
<typesystem package="PySide2.QtCore">
- <primitive-type name="Qt::HANDLE" target-lang-api-name="PyObject" />
+ <primitive-type name="Qt::HANDLE" target-lang-api-name="PyObject"/>
<!-- Qt5: had to move QAbstractEventDispatcher into os-specific files because of Windows -->
<object-type name="QAbstractEventDispatcher">
<modify-function signature="processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag>)" allow-thread="yes"/>
@@ -50,8 +50,8 @@
<object-type name="QSysInfo">
<enum-type name="Endian"/>
<enum-type name="Sizes"/>
- <enum-type name="MacVersion" since="5.5" />
+ <enum-type name="MacVersion" since="5.5"/>
</object-type>
- <suppress-warning text="skipping field 'QSysInfo::WindowsVersion' with unmatched type 'QSysInfo::WinVersion'" />
- <suppress-warning text="enum 'QSysInfo::WinVersion' does not have a type entry or is not an enum" />
+ <suppress-warning text="skipping field 'QSysInfo::WindowsVersion' with unmatched type 'QSysInfo::WinVersion'"/>
+ <suppress-warning text="enum 'QSysInfo::WinVersion' does not have a type entry or is not an enum"/>
</typesystem>
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_win.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_win.xml
index 410187281..afd733b35 100644
--- a/sources/pyside2/PySide2/QtCore/typesystem_core_win.xml
+++ b/sources/pyside2/PySide2/QtCore/typesystem_core_win.xml
@@ -43,7 +43,7 @@
<extra-includes>
<include file-name="windows.h" location="global"/>
</extra-includes>
- <primitive-type name="Qt::HANDLE" target-lang-api-name="PyObject" />
+ <primitive-type name="Qt::HANDLE" target-lang-api-name="PyObject"/>
<primitive-type name="HWND">
<!-- Qt5: Add this include there to insert ti in the global qtcore header (needed by qprocess_wrapper) -->
<include file-name="wtypes.h" location="global"/>
@@ -74,7 +74,7 @@
</inject-code>
<!-- Qt5: had to move QAbstractEventDispatcher into os-specific files because of Windows -->
- <object-type name="QWinEventNotifier" />
+ <object-type name="QWinEventNotifier"/>
<object-type name="QAbstractEventDispatcher">
<modify-function signature="processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag>)" allow-thread="yes"/>
<!-- Qt5: had to add this recursive object def. This was crucial to get rid of "pure virtual" -->
@@ -83,8 +83,8 @@
<object-type name="QSysInfo">
<enum-type name="Endian"/>
<enum-type name="Sizes"/>
- <enum-type name="WinVersion" since="5.5" />
+ <enum-type name="WinVersion" since="5.5"/>
</object-type>
- <suppress-warning text="skipping field 'QSysInfo::MacintoshVersion' with unmatched type 'QSysInfo::MacVersion'" />
- <suppress-warning text="enum 'QSysInfo::MacVersion' does not have a type entry or is not an enum" />
+ <suppress-warning text="skipping field 'QSysInfo::MacintoshVersion' with unmatched type 'QSysInfo::MacVersion'"/>
+ <suppress-warning text="enum 'QSysInfo::MacVersion' does not have a type entry or is not an enum"/>
</typesystem>
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_x11.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_x11.xml
index d5b0bae3b..c3cbd3666 100644
--- a/sources/pyside2/PySide2/QtCore/typesystem_core_x11.xml
+++ b/sources/pyside2/PySide2/QtCore/typesystem_core_x11.xml
@@ -54,8 +54,8 @@
<enum-type name="Endian"/>
<enum-type name="Sizes"/>
</object-type>
- <suppress-warning text="skipping field 'QSysInfo::MacintoshVersion' with unmatched type 'QSysInfo::MacVersion'" />
- <suppress-warning text="skipping field 'QSysInfo::WindowsVersion' with unmatched type 'QSysInfo::MacVersion'" />
- <suppress-warning text="enum 'QSysInfo::MacVersion' does not have a type entry or is not an enum" />
- <suppress-warning text="enum 'QSysInfo::WinVersion' does not have a type entry or is not an enum" />
+ <suppress-warning text="skipping field 'QSysInfo::MacintoshVersion' with unmatched type 'QSysInfo::MacVersion'"/>
+ <suppress-warning text="skipping field 'QSysInfo::WindowsVersion' with unmatched type 'QSysInfo::MacVersion'"/>
+ <suppress-warning text="enum 'QSysInfo::MacVersion' does not have a type entry or is not an enum"/>
+ <suppress-warning text="enum 'QSysInfo::WinVersion' does not have a type entry or is not an enum"/>
</typesystem>
diff --git a/sources/pyside2/PySide2/QtDataVisualization/typesystem_datavisualization.xml b/sources/pyside2/PySide2/QtDataVisualization/typesystem_datavisualization.xml
index d2018ffca..2777f5519 100644
--- a/sources/pyside2/PySide2/QtDataVisualization/typesystem_datavisualization.xml
+++ b/sources/pyside2/PySide2/QtDataVisualization/typesystem_datavisualization.xml
@@ -73,7 +73,7 @@
result.append(row);
}
</template>
- <load-typesystem name="QtGui/typesystem_gui.xml" generate="no" />
+ <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
<namespace-type name="QtDataVisualization">
<primitive-type name="QBarDataArray">
<include file-name="qbardataproxy.h" location="global"/>
@@ -313,9 +313,7 @@
<modify-argument index="1">
<reference-count action="set"/>
</modify-argument>
- <inject-code>
- Shiboken::Object::releaseOwnership(%PYARG_1);
- </inject-code>
+ <inject-code file="../glue/qtdatavisualization.cpp" snippet="releaseownership"/>
</modify-function>
<modify-function signature="setColumnAxis(QtDataVisualization::QCategory3DAxis*)">
<modify-argument index="1">
@@ -343,9 +341,7 @@
<modify-argument index="1">
<reference-count action="set"/>
</modify-argument>
- <inject-code>
- Shiboken::Object::releaseOwnership(%PYARG_1);
- </inject-code>
+ <inject-code file="../glue/qtdatavisualization.cpp" snippet="releaseownership"/>
</modify-function>
<modify-function signature="setAxisX(QtDataVisualization::QValue3DAxis*)">
<modify-argument index="1">
@@ -374,9 +370,7 @@
<modify-argument index="1">
<reference-count action="set"/>
</modify-argument>
- <inject-code>
- Shiboken::Object::releaseOwnership(%PYARG_1);
- </inject-code>
+ <inject-code file="../glue/qtdatavisualization.cpp" snippet="releaseownership"/>
</modify-function>
<modify-function signature="setAxisX(QtDataVisualization::QValue3DAxis*)">
<modify-argument index="1">
@@ -418,25 +412,19 @@
<modify-argument index="1">
<reference-count action="set"/>
</modify-argument>
- <inject-code>
- Shiboken::Object::releaseOwnership(%PYARG_1);
- </inject-code>
+ <inject-code file="../glue/qtdatavisualization.cpp" snippet="releaseownership"/>
</modify-function>
<modify-function signature="releaseInputHandler(QtDataVisualization::QAbstract3DInputHandler*)">
<modify-argument index="1">
<reference-count action="set"/>
</modify-argument>
- <inject-code>
- Shiboken::Object::releaseOwnership(%PYARG_1);
- </inject-code>
+ <inject-code file="../glue/qtdatavisualization.cpp" snippet="releaseownership"/>
</modify-function>
<modify-function signature="releaseTheme(QtDataVisualization::Q3DTheme*)">
<modify-argument index="1">
<reference-count action="set"/>
</modify-argument>
- <inject-code>
- Shiboken::Object::releaseOwnership(%PYARG_1);
- </inject-code>
+ <inject-code file="../glue/qtdatavisualization.cpp" snippet="releaseownership"/>
</modify-function>
<modify-function signature="setActiveInputHandler(QtDataVisualization::QAbstract3DInputHandler*)">
<modify-argument index="1">
diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
index e2e3b2335..1d09dee7a 100644
--- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
+++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
@@ -55,22 +55,22 @@
</template>
<rejection class="^Q.*$" argument-type="^QPlatform.*$"/>
- <function signature="qAlpha(uint)" />
- <function signature="qBlue(uint)" />
- <function signature="qGray(int,int,int)" />
- <function signature="qGray(uint)" />
- <function signature="qGreen(uint)" />
- <function signature="qIsGray(uint)" />
- <function signature="qRed(uint)" />
- <function signature="qRgb(int,int,int)" />
- <function signature="qRgba(int,int,int,int)" />
- <function signature="qFuzzyCompare(QMatrix,QMatrix)" />
- <function signature="qFuzzyCompare(QTransform,QTransform)" />
- <function signature="qFuzzyCompare(QQuaternion,QQuaternion)" />
- <function signature="qFuzzyCompare(QMatrix4x4,QMatrix4x4)" />
- <function signature="qFuzzyCompare(QVector2D,QVector2D)" />
- <function signature="qFuzzyCompare(QVector3D,QVector3D)" />
- <function signature="qFuzzyCompare(QVector4D,QVector4D)" />
+ <function signature="qAlpha(uint)"/>
+ <function signature="qBlue(uint)"/>
+ <function signature="qGray(int,int,int)"/>
+ <function signature="qGray(uint)"/>
+ <function signature="qGreen(uint)"/>
+ <function signature="qIsGray(uint)"/>
+ <function signature="qRed(uint)"/>
+ <function signature="qRgb(int,int,int)"/>
+ <function signature="qRgba(int,int,int,int)"/>
+ <function signature="qFuzzyCompare(QMatrix,QMatrix)"/>
+ <function signature="qFuzzyCompare(QTransform,QTransform)"/>
+ <function signature="qFuzzyCompare(QQuaternion,QQuaternion)"/>
+ <function signature="qFuzzyCompare(QMatrix4x4,QMatrix4x4)"/>
+ <function signature="qFuzzyCompare(QVector2D,QVector2D)"/>
+ <function signature="qFuzzyCompare(QVector3D,QVector3D)"/>
+ <function signature="qFuzzyCompare(QVector4D,QVector4D)"/>
<rejection class="*" function-name="qobject_interface_iid&lt;QStyleFactoryInterface*&gt;"/>
<rejection class="*" function-name="qobject_interface_iid&lt;QAccessibleFactoryInterface*&gt;"/>
<rejection class="*" function-name="qobject_interface_iid&lt;QInputContextFactoryInterface*&gt;"/>
@@ -257,9 +257,9 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f, %f, %f, %f, %f, %f, %f, %f" />
+ <replace from="%REPR_FORMAT" to="%f, %f, %f, %f, %f, %f, %f, %f, %f"/>
<replace from="%REPR_ARGS"
- to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m13(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.m23(), %CPPSELF.m31(), %CPPSELF.m32(), %CPPSELF.m33()" />
+ to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m13(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.m23(), %CPPSELF.m31(), %CPPSELF.m32(), %CPPSELF.m33()"/>
</insert-template>
</inject-code>
</add-function>
@@ -267,16 +267,16 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="ddddddddd" />
+ <replace from="%REDUCE_FORMAT" to="ddddddddd"/>
<replace from="%REDUCE_ARGS"
- to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m13(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.m23(), %CPPSELF.m31(), %CPPSELF.m32(), %CPPSELF.m33()" />
+ to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m13(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.m23(), %CPPSELF.m31(), %CPPSELF.m32(), %CPPSELF.m33()"/>
</insert-template>
</inject-code>
</add-function>
<modify-function signature="map(qreal,qreal,qreal*,qreal*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="3">
<remove-argument/>
@@ -286,7 +286,7 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_args,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
@@ -306,38 +306,14 @@
</inject-code>
</modify-function>
<add-function signature="quadToQuad(QPolygonF&amp;,QPolygonF&amp;)" return-type="PyObject*" static="true">
- <inject-code>
- QTransform _result;
- if (QTransform::quadToQuad(%1, %2, _result)) {
- %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);
- } else {
- Py_INCREF(Py_None);
- %PYARG_0 = Py_None;
- }
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qtransform-quadtoquad"/>
</add-function>
<add-function signature="quadToSquare(QPolygonF &amp;)" return-type="PyObject*" static="true">
- <inject-code>
- QTransform _result;
- if (QTransform::quadToSquare(%1, _result)) {
- %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);
- } else {
- Py_INCREF(Py_None);
- %PYARG_0 = Py_None;
- }
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qtransform-quadtosquare"/>
</add-function>
<add-function signature="squareToQuad(QPolygonF &amp;)" return-type="PyObject*" static="true">
- <inject-code>
- QTransform _result;
- if (QTransform::squareToQuad(%1, _result)) {
- %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);
- } else {
- Py_INCREF(Py_None);
- %PYARG_0 = Py_None;
- }
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qtransform-squaretoquad"/>
</add-function>
<!-- Disambiguate from Qt3DCore/qtransform.h -->
<include file-name="QtGui/qtransform.h" location="global"/>
@@ -346,21 +322,17 @@
<value-type name="QStaticText">
<enum-type name="PerformanceHint"/>
</value-type>
- <value-type name="QTextFragment" />
+ <value-type name="QTextFragment"/>
<value-type name="QBitmap" >
<modify-function signature="fromData(QSize,const uchar*,QImage::Format)">
<modify-argument index="2">
<replace-type modified-type="PyBuffer"/>
</modify-argument>
- <inject-code>
- uchar *buffer = reinterpret_cast&lt;uchar*&gt;(Shiboken::Buffer::getPointer(%PYARG_2));
- QBitmap %0 = QBitmap::fromData(%1, buffer, %3);
- %PYARG_0 = %CONVERTTOPYTHON[QBitmap](%0);
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qbitmap-fromdata"/>
</modify-function>
</value-type>
- <value-type name="QTextInlineObject" />
- <value-type name="QTextDocumentFragment" />
+ <value-type name="QTextInlineObject"/>
+ <value-type name="QTextDocumentFragment"/>
<value-type name="QTextOption">
<enum-type name="Flag" flags="Flags"/>
<enum-type name="TabType"/>
@@ -370,19 +342,12 @@
<value-type name="QTextLine" >
<enum-type name="CursorPosition"/>
<enum-type name="Edge"/>
- <modify-function signature="cursorToX(int*,QTextLine::Edge)const" remove="all" />
+ <modify-function signature="cursorToX(int*,QTextLine::Edge)const" remove="all"/>
<modify-function signature="cursorToX(int,QTextLine::Edge)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- %BEGIN_ALLOW_THREADS
- %RETURN_TYPE %0 = %CPPSELF->::%TYPE::%FUNCTION_NAME(&amp;%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));
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qtextline-cursortox"/>
</modify-function>
<modify-function signature="xToCursor(qreal,QTextLine::CursorPosition)const">
<modify-argument index="2">
@@ -390,8 +355,8 @@
</modify-argument>
</modify-function>
</value-type>
- <value-type name="QTextTableFormat" />
- <value-type name="QTextImageFormat" />
+ <value-type name="QTextTableFormat"/>
+ <value-type name="QTextImageFormat"/>
<value-type name="QTextFrameFormat" >
<enum-type name="BorderStyle"/>
<enum-type name="Position"/>
@@ -406,11 +371,11 @@
</value-type>
</value-type>
<value-type name="QPalette">
- <enum-type name="ColorGroup" />
- <enum-type name="ColorRole" />
+ <enum-type name="ColorGroup"/>
+ <enum-type name="ColorRole"/>
</value-type>
<object-type name="QInputMethod">
- <enum-type name="Action" />
+ <enum-type name="Action"/>
</object-type>
<value-type name="QKeySequence">
<enum-type name="SequenceFormat"/>
@@ -420,9 +385,9 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%i, %i, %i, %i" />
+ <replace from="%REPR_FORMAT" to="%i, %i, %i, %i"/>
<replace from="%REPR_ARGS"
- to="(*%CPPSELF)[0], (*%CPPSELF)[1], (*%CPPSELF)[2], (*%CPPSELF)[3]" />
+ to="(*%CPPSELF)[0], (*%CPPSELF)[1], (*%CPPSELF)[2], (*%CPPSELF)[3]"/>
</insert-template>
</inject-code>
</add-function>
@@ -430,22 +395,15 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="iiii" />
- <replace from="%REDUCE_ARGS" to="(*%CPPSELF)[0], (*%CPPSELF)[1], (*%CPPSELF)[2], (*%CPPSELF)[3]" />
+ <replace from="%REDUCE_FORMAT" to="iiii"/>
+ <replace from="%REDUCE_ARGS" to="(*%CPPSELF)[0], (*%CPPSELF)[1], (*%CPPSELF)[2], (*%CPPSELF)[3]"/>
</insert-template>
</inject-code>
</add-function>
<modify-function signature="operator[](uint)const" remove="all"/>
<add-function signature="__getitem__">
- <inject-code class="target" position="beginning">
- if (_i &lt; 0 || _i >= %CPPSELF.count()) {
- PyErr_SetString(PyExc_IndexError, "index out of bounds");
- return 0;
- }
- int item = (*%CPPSELF)[_i];
- return %CONVERTTOPYTHON[int](item);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qkeysequence-getitem"/>
</add-function>
<!-- ### Not necessary due the PySide QVariant conversion rules -->
@@ -461,9 +419,7 @@
<modify-argument index="return">
<replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code>
- %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.data(), %CPPSELF.size());
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qpicture-data"/>
</modify-function>
<modify-function signature="setData(const char*,uint)">
<modify-argument index="1">
@@ -502,13 +458,13 @@
<!-- ### -->
<add-function signature="__iter__()" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="__iter__" />
+ <insert-template name="__iter__"/>
</inject-code>
</add-function>
<add-function signature="__next__()" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="__next__">
- <replace from="%CPPSELF_TYPE" to="QTextBlock::iterator" />
+ <replace from="%CPPSELF_TYPE" to="QTextBlock::iterator"/>
</insert-template>
</inject-code>
</add-function>
@@ -516,36 +472,24 @@
<add-function signature="__iter__()" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="__iter_parent__">
- <replace from="%CPPSELF_TYPE" to="QTextBlock::iterator" />
+ <replace from="%CPPSELF_TYPE" to="QTextBlock::iterator"/>
</insert-template>
</inject-code>
</add-function>
<modify-function signature="setUserData(QTextBlockUserData*)">
- <inject-code class="target" position="end">
- const QTextDocument *doc = %CPPSELF.document();
- if (doc) {
- Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc));
- Shiboken::Object::setParent(pyDocument, %PYARG_1);
- }
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtgui.cpp" snippet="qtextblock-setuserdata"/>
</modify-function>
<modify-function signature="userData()const">
<modify-argument index="return">
<define-ownership class="target" owner="default"/>
</modify-argument>
- <inject-code class="target" position="end">
- const QTextDocument *doc = %CPPSELF.document();
- if (doc) {
- Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc));
- Shiboken::Object::setParent(pyDocument, %PYARG_0);
- }
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtgui.cpp" snippet="qtextblock-userdata"/>
</modify-function>
</value-type>
<value-type name="QTextBlockFormat">
<enum-type name="LineHeightTypes" since="4.8" revision="4800"/>
</value-type>
- <value-type name="QTextTableCellFormat" />
+ <value-type name="QTextTableCellFormat"/>
<value-type name="QTextCharFormat" >
<enum-type name="FontPropertiesInheritanceBehavior"/>
<enum-type name="UnderlineStyle"/>
@@ -555,7 +499,7 @@
<enum-type name="FormatType"/>
<enum-type name="ObjectTypes"/>
<enum-type name="PageBreakFlag" flags="PageBreakFlags"/>
- <enum-type name="Property" />
+ <enum-type name="Property"/>
</value-type>
<value-type name="QTextListFormat">
<enum-type name="Style"/>
@@ -566,17 +510,10 @@
<include file-name="QTransform" location="global"/>
</extra-includes>
<add-function signature="__reduce__" return-type="PyObject*">
- <inject-code class="target" position="beginning">
- PyObject *points = PyList_New(%CPPSELF.count());
- for (int i = 0, max = %CPPSELF.count(); i &lt; max; ++i){
- int x, y;
- %CPPSELF.point(i, &amp;x, &amp;y);
- QPoint pt = QPoint(x, y);
- PyList_SET_ITEM(points, i, %CONVERTTOPYTHON[QPoint](pt));
- }
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qpolygon-reduce">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="N" />
- <replace from="%REDUCE_ARGS" to="points" />
+ <replace from="%REDUCE_FORMAT" to="N"/>
+ <replace from="%REDUCE_ARGS" to="points"/>
</insert-template>
</inject-code>
</add-function>
@@ -586,18 +523,10 @@
<!-- ### A QVector parameter, for no defined type, will generate wrong code. -->
<modify-function signature="operator+=(QVector&lt;QPoint&gt;)" remove="all"/>
<modify-function signature="operator&lt;&lt;(QPoint)">
- <inject-code>
- // %FUNCTION_NAME()
- *%CPPSELF &lt;&lt; %1;
- %PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF);
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qpolygon-operatorlowerlower"/>
</modify-function>
<modify-function signature="operator&lt;&lt;(QVector&lt;QPoint&gt;)">
- <inject-code>
- // %FUNCTION_NAME()
- *%CPPSELF &lt;&lt; %1;
- %PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF);
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qpolygon-operatorlowerlower"/>
</modify-function>
<!-- ### -->
</value-type>
@@ -658,16 +587,14 @@
<modify-argument index="1">
<rename to="image"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- %0 = new %TYPE(QPixmap::fromImage(%1));
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qpixmap"/>
</add-function>
<modify-function signature="QPixmap(const char*const[])">
<modify-argument index="1">
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="load_xpm" />
+ <insert-template name="load_xpm"/>
</inject-code>
</modify-function>
@@ -699,7 +626,7 @@
<enum-type name="SelectionType"/>
<modify-function signature="selectedTableCells(int*,int*,int*,int*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -715,12 +642,12 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
<inject-code class="native" position="end">
<insert-template name="fix_native_return_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
@@ -749,9 +676,9 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f, %f, %f, %f, %f" />
+ <replace from="%REPR_FORMAT" to="%f, %f, %f, %f, %f, %f"/>
<replace from="%REPR_ARGS"
- to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()" />
+ to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()"/>
</insert-template>
</inject-code>
</add-function>
@@ -759,8 +686,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="dddddd" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()" />
+ <replace from="%REDUCE_FORMAT" to="dddddd"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()"/>
</insert-template>
</inject-code>
</add-function>
@@ -779,7 +706,7 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="qmatrix_map" />
+ <insert-template name="qmatrix_map"/>
</inject-code>
</modify-function>
<modify-function signature="map(qreal,qreal,qreal*,qreal*)const">
@@ -790,7 +717,7 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="qmatrix_map" />
+ <insert-template name="qmatrix_map"/>
</inject-code>
</modify-function>
<modify-function signature="inverted(bool*)const">
@@ -806,15 +733,15 @@
</modify-function>
</value-type>
- <value-type name="QConicalGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::ConicalGradient" />
- <value-type name="QFontInfo" />
- <value-type name="QRadialGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::RadialGradient" />
+ <value-type name="QConicalGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::ConicalGradient"/>
+ <value-type name="QFontInfo"/>
+ <value-type name="QRadialGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::RadialGradient"/>
<value-type name="QFont" >
<enum-type name="Capitalization"/>
<enum-type name="SpacingType"/>
<enum-type name="Stretch"/>
<enum-type name="Style"/>
- <enum-type name="StyleHint" />
+ <enum-type name="StyleHint"/>
<enum-type name="StyleStrategy"/>
<enum-type name="Weight"/>
<enum-type name="HintingPreference" since="4.8" revision="4800"/>
@@ -837,7 +764,7 @@
<include file-name="QImage" location="global"/>
</extra-includes>
</function> -->
- <primitive-type name="QImageCleanupFunction" />
+ <primitive-type name="QImageCleanupFunction"/>
<value-type name="QImage">
<enum-type name="Format"/>
<enum-type name="InvertMode"/>
@@ -856,7 +783,7 @@
</modify-argument>
<inject-code>
<insert-template name="qimage_buffer_constructor">
- <replace from="%ARGS" to="%2, %3, %4, %5" />
+ <replace from="%ARGS" to="%2, %3, %4, %5"/>
</insert-template>
</inject-code>
</modify-function>
@@ -866,7 +793,7 @@
</modify-argument>
<inject-code>
<insert-template name="qimage_buffer_constructor">
- <replace from="%ARGS" to="%2, %3, %4" />
+ <replace from="%ARGS" to="%2, %3, %4"/>
</insert-template>
</inject-code>
</modify-function>
@@ -874,61 +801,52 @@
<add-function signature="QImage(QString&amp;,int,int,int,QImage::Format)">
<inject-code>
<insert-template name="qimage_buffer_constructor">
- <replace from="%ARGS" to="%2, %3, %4, %5" />
+ <replace from="%ARGS" to="%2, %3, %4, %5"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QImage(QString&amp;,int,int,QImage::Format)">
<inject-code>
<insert-template name="qimage_buffer_constructor">
- <replace from="%ARGS" to="%2, %3, %4" />
+ <replace from="%ARGS" to="%2, %3, %4"/>
</insert-template>
</inject-code>
</add-function>
<!-- The non-const versions are already used -->
<modify-function signature="QImage(const uchar*,int,int,int,QImage::Format,QImageCleanupFunction,void*)" remove="all"/>
- <modify-function signature="QImage(const uchar*,int,int,QImage::Format,QImageCleanupFunction,void*)" remove="all" />
+ <modify-function signature="QImage(const uchar*,int,int,QImage::Format,QImageCleanupFunction,void*)" remove="all"/>
<!-- ### -->
<modify-function signature="QImage(const char*const[])">
<modify-argument index="1">
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="load_xpm" />
+ <insert-template name="load_xpm"/>
</inject-code>
</modify-function>
<!-- ### There is already an fromData with a QByteArray type (that is convertible from Python's str) as the first type. -->
<modify-function signature="fromData(const uchar*,int,const char*)" remove="all"/>
<!-- ### There is already an loadFromData with a QByteArray type (that is convertible from Python's str) as the first type. -->
- <modify-function signature="loadFromData(const uchar*,int,const char*)" remove="all" />
+ <modify-function signature="loadFromData(const uchar*,int,const char*)" remove="all"/>
<modify-function signature="constBits()const" since="4.7">
- <inject-code>
- %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.byteCount());
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qimage-constbits"/>
</modify-function>
<modify-function signature="bits()">
- <inject-code>
- // 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);
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qimage-bits"/>
</modify-function>
<modify-function signature="constScanLine(int)const" since="4.7">
- <inject-code>
- %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1), %CPPSELF.bytesPerLine());
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qimage-constscanline"/>
<modify-argument index="return">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
</modify-function>
<modify-function signature="scanLine(int)">
- <inject-code>
- %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1), %CPPSELF.bytesPerLine(), Shiboken::Buffer::ReadWrite);
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qimage-scanline"/>
<modify-argument index="return">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
</modify-function>
<!--
@@ -955,8 +873,8 @@
<extra-includes>
<include file-name="QStringList" location="global"/>
</extra-includes>
- <enum-type name="SystemFont" />
- <enum-type name="WritingSystem" />
+ <enum-type name="SystemFont"/>
+ <enum-type name="WritingSystem"/>
</value-type>
<value-type name="QPen">
<extra-includes>
@@ -1019,117 +937,36 @@
</extra-includes>
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="qcolor_repr" />
+ <insert-template name="qcolor_repr"/>
</inject-code>
</add-function>
<add-function signature="__str__" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="qcolor_repr" />
+ <insert-template name="qcolor_repr"/>
</inject-code>
</add-function>
<add-function signature="__setstate__(PyObject*)" return-type="PyObject">
- <inject-code>
- Shiboken::AutoDecRef func(PyObject_GetAttr(%PYSELF, PyTuple_GET_ITEM(%1, 0)));
- PyObject *args = PyTuple_GET_ITEM(%1, 1);
- %PYARG_0 = PyObject_Call(func, args, NULL);
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qcolor-setstate"/>
</add-function>
<add-function signature="__reduce__" return-type="PyObject">
- <inject-code class="target" position="beginning">
- switch(%CPPSELF.spec()) {
- case QColor::Rgb:
- {
- qreal r, g, b, a;
- %CPPSELF.getRgbF(&amp;r, &amp;g, &amp;b, &amp;a);
- %PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setRgbF", (float)r, (float)g, (float)b, (float)a);
- break;
- }
- case QColor::Hsv:
- {
- qreal h, s, v, a;
- %CPPSELF.getHsvF(&amp;h, &amp;s, &amp;v, &amp;a);
- %PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setHsvF", (float)h, (float)s, (float)v, (float)a);
- break;
- }
- case QColor::Cmyk:
- {
- qreal c, m, y, k, a;
- %CPPSELF.getCmykF(&amp;c, &amp;m, &amp;y, &amp;k, &amp;a);
- %PYARG_0 = Py_BuildValue("(ON(s(fffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setCmykF", (float)c, (float)m, (float)y, (float)k, (float)a);
- break;
- }
- #if QT_VERSION >= 0x040600
- case QColor::Hsl:
- {
- qreal h, s, l, a;
- %CPPSELF.getHslF(&amp;h, &amp;s, &amp;l, &amp;a);
- %PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setHslF", (float)h, (float)s, (float)l, (float)a);
- break;
- }
- #endif
- default:
- {
- %PYARG_0 = Py_BuildValue("(N(O))", PyObject_Type(%PYSELF), Py_None);
- }
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qcolor-reduce"/>
</add-function>
<add-function signature="toTuple" return-type="PyObject">
- <inject-code class="target" position="beginning">
- switch(%CPPSELF.spec()) {
- case QColor::Rgb:
- {
- int r, g, b, a;
- %CPPSELF.getRgb(&amp;r, &amp;g, &amp;b, &amp;a);
- %PYARG_0 = Py_BuildValue("iiii", r, g, b, a);
- break;
- }
- case QColor::Hsv:
- {
- int h, s, v, a;
- %CPPSELF.getHsv(&amp;h, &amp;s, &amp;v, &amp;a);
- %PYARG_0 = Py_BuildValue("iiii", h, s, v, a);
- break;
- }
- case QColor::Cmyk:
- {
- int c, m, y, k, a;
- %CPPSELF.getCmyk(&amp;c, &amp;m, &amp;y, &amp;k, &amp;a);
- %PYARG_0 = Py_BuildValue("iiiii", c, m, y, k, a);
- break;
- }
- case QColor::Hsl:
- {
- int h, s, l, a;
- %CPPSELF.getHsl(&amp;h, &amp;s, &amp;l, &amp;a);
- %PYARG_0 = Py_BuildValue("iiii", h, s, l, a);
- break;
- }
- default:
- {
- %PYARG_0 = 0;
- }
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qcolor-totuple"/>
</add-function>
<!-- ### "QColor(QColor::Spec)" is an internal method. -->
<modify-function signature="QColor(QColor::Spec)" remove="all"/>
<!-- ### Constructor removed because we already have an overload using QString. -->
- <modify-function signature="QColor(const char*)" remove="all" />
+ <modify-function signature="QColor(const char*)" remove="all"/>
<!-- ### -->
<add-function signature="QColor(QVariant)">
- <inject-code class="target" position="beginning">
- if (%1.type() == QVariant::Color)
- %0 = new %TYPE(%1.value&lt;QColor>());
- else
- PyErr_SetString(PyExc_TypeError, "QVariant must be holding a QColor");
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qcolor"/>
</add-function>
<!-- get* methods. Inject code -->
<modify-function signature="getCmyk(int*,int*,int*,int*,int*)">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1150,13 +987,13 @@
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getCmykF(qreal*,qreal*,qreal*,qreal*,qreal*)">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1177,13 +1014,13 @@
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getHsl(int*,int*,int*,int*)const" since="4.6">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1200,13 +1037,13 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getHslF(qreal*,qreal*,qreal*,qreal*)const" since="4.6">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1223,13 +1060,13 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getHsv(int*,int*,int*,int*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1246,13 +1083,13 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getHsvF(qreal*,qreal*,qreal*,qreal*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1269,13 +1106,13 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getRgb(int*,int*,int*,int*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1292,13 +1129,13 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getRgbF(qreal*,qreal*,qreal*,qreal*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1315,7 +1152,7 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
@@ -1344,56 +1181,14 @@
<modify-argument index="5">
<replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- 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);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qfontmetricsf-boundingrect"/>
</modify-function>
<modify-function signature="size(int,QString,int,int*)const">
<modify-argument index="4">
<replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- 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);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qfontmetricsf-size"/>
</modify-function>
</value-type>
<value-type name="QFontMetrics" >
@@ -1420,85 +1215,21 @@
<modify-argument index="8">
<replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- 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);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qfontmetrics-boundingrect-1"/>
</modify-function>
<modify-function signature="boundingRect(QRect,int,QString,int,int*)const">
<modify-argument index="5">
<replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- 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);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qfontmetrics-boundingrect-2"/>
</modify-function>
<modify-function signature="size(int,QString,int,int*)const">
<modify-argument index="4">
<replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- 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);
- }
-
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qfontmetrics-size"/>
</modify-function>
</value-type>
<value-type name="QGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::NoGradient">
@@ -1508,20 +1239,20 @@
<enum-type name="Spread"/>
<enum-type name="Type"/>
</value-type>
- <value-type name="QLinearGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::LinearGradient" />
+ <value-type name="QLinearGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::LinearGradient"/>
<object-type name="QPaintDevice">
<enum-type name="PaintDeviceMetric"/>
</object-type>
<object-type name="QPagedPaintDevice">
- <value-type name="Margins" />
- <enum-type name="PageSize" />
+ <value-type name="Margins"/>
+ <enum-type name="PageSize"/>
<enum-type name="PdfVersion" since="5.10"/>
</object-type>
<object-type name="QAbstractTextDocumentLayout">
<value-type name="PaintContext" >
<include file-name="QAbstractTextDocumentLayout" location="global"/>
</value-type>
- <value-type name="Selection" />
+ <value-type name="Selection"/>
<modify-function signature="setPaintDevice(QPaintDevice*)">
<modify-argument index="1">
<parent index="this" action="add"/>
@@ -1534,15 +1265,15 @@
<modify-argument index="1" invalidate-after-use="yes"/>
</modify-function>
</object-type>
- <object-type name="QPyTextObject" />
+ <object-type name="QPyTextObject"/>
- <object-type name="QDesktopServices" since="4.2" />
+ <object-type name="QDesktopServices" since="4.2"/>
<object-type name="QDoubleValidator">
<enum-type name="Notation"/>
</object-type>
<object-type name="QIconEngine">
- <object-type name="AvailableSizesArgument" />
- <enum-type name="IconEngineHook" />
+ <object-type name="AvailableSizesArgument"/>
+ <enum-type name="IconEngineHook"/>
<modify-function signature="paint(QPainter*,QRect,QIcon::Mode,QIcon::State)">
<modify-argument index="1" invalidate-after-use="yes"/>
</modify-function>
@@ -1564,7 +1295,7 @@
</modify-function>
<modify-function signature="write(const QImage&amp;)" allow-thread="yes"/>
</object-type>
- <object-type name="QIntValidator" />
+ <object-type name="QIntValidator"/>
<object-type name="QPainterPathStroker" copyable="false"/>
<object-type name="QPictureIO">
@@ -1577,19 +1308,11 @@
<object-type name="QPixmapCache">
<value-type name="Key"/>
<add-function signature="find(QPixmapCache::Key&amp;)">
- <inject-code>
- QPixmap p;
- if (%CPPSELF.%FUNCTION_NAME(%1, &amp;p)) {
- %PYARG_0 = %CONVERTTOPYTHON[QPixmap](p);
- } else {
- %PYARG_0 = Py_None;
- Py_INCREF(%PYARG_0);
- }
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qpixmapcache-find"/>
</add-function>
</object-type>
- <object-type name="QRegExpValidator" />
+ <object-type name="QRegExpValidator"/>
<object-type name="QStandardItem">
<enum-type name="ItemType"/>
@@ -1641,27 +1364,13 @@
</modify-function>
<modify-function signature="setChild(int,int,QStandardItem*)">
- <inject-code class="target" position="beginning">
- // Clear parent from the old child
- QStandardItem *_i = %CPPSELF->child(%1, %2);
- if (_i) {
- PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
- Shiboken::Object::setParent(0, _pyI);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qstandarditem-setchild-1"/>
<modify-argument index="3">
<parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="setChild(int,QStandardItem*)">
- <inject-code class="target" position="beginning">
- // Clear parent from the old child
- QStandardItem *_i = %CPPSELF->child(%1);
- if (_i) {
- PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
- Shiboken::Object::setParent(0, _pyI);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qstandarditem-setchild-2"/>
<modify-argument index="2">
<parent index="this" action="add"/>
</modify-argument>
@@ -1700,8 +1409,8 @@
</modify-argument>
</modify-function>
</object-type>
- <object-type name="QTextBlockGroup" />
- <object-type name="QTextBlockUserData" />
+ <object-type name="QTextBlockGroup"/>
+ <object-type name="QTextBlockUserData"/>
<object-type name="QTextItem">
<enum-type name="RenderFlag" flags="RenderFlags"/>
</object-type>
@@ -1778,25 +1487,25 @@
</modify-function>
</object-type>
- <object-type name="QActionEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ActionAdded || %1-&gt;type() == QEvent::ActionRemoved || %1-&gt;type() == QEvent::ActionChanged" />
+ <object-type name="QActionEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ActionAdded || %1-&gt;type() == QEvent::ActionRemoved || %1-&gt;type() == QEvent::ActionChanged"/>
<object-type name="QCloseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Close"/>
<object-type name="QContextMenuEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ContextMenu">
<enum-type name="Reason"/>
</object-type>
<object-type name="QDragEnterEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragEnter"/>
<object-type name="QDragLeaveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragLeave"/>
- <object-type name="QDragMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragMove" />
+ <object-type name="QDragMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragMove"/>
<object-type name="QDropEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Drop">
<modify-function signature="source()const">
<modify-argument index="return">
- <define-ownership class="target" owner="default" />
+ <define-ownership class="target" owner="default"/>
</modify-argument>
</modify-function>
</object-type>
<object-type name="QEnterEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::Enter"/>
- <object-type name="QExposeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Expose" />
- <object-type name="QFileOpenEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FileOpen" />
- <object-type name="QFocusEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FocusIn || %1-&gt;type() == QEvent::FocusOut" />
+ <object-type name="QExposeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Expose"/>
+ <object-type name="QFileOpenEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FileOpen"/>
+ <object-type name="QFocusEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FocusIn || %1-&gt;type() == QEvent::FocusOut"/>
<object-type name="QHelpEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolTip || %1-&gt;type() == QEvent::WhatsThis"/>
<object-type name="QHideEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::Hide"/>
<object-type name="QHoverEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::HoverEnter || %1-&gt;type() == QEvent::HoverLeave || %1-&gt;type() == QEvent::HoverMove"/>
@@ -1812,7 +1521,7 @@
</object-type>
<object-type name="QInputMethodQueryEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::InputMethodQuery"/>
- <object-type name="QMoveEvent" copyable = "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Move" />
+ <object-type name="QMoveEvent" copyable = "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Move"/>
<object-type name="QNativeGestureEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::NativeGesture"/>
<object-type name="QResizeEvent" copyable = "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Resize"/>
<object-type name="QShortcutEvent" copyable = "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Shortcut">
@@ -1827,16 +1536,13 @@
<object-type name="QWhatsThisClickedEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::WhatsThisClicked"/>
<object-type name="QWheelEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Wheel"/>
<!-- Qt5.5: suppress this nameless enum -->
- <suppress-warning text="enum 'QWheelEvent::DefaultDeltasPerStep' does not have a type entry or is not an enum" />
+ <suppress-warning text="enum 'QWheelEvent::DefaultDeltasPerStep' does not have a type entry or is not an enum"/>
<object-type name="QWindowStateChangeEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::WindowStateChange"/>
<object-type name="QInputEvent" copyable="false"/>
<object-type name="QKeyEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::KeyPress || %1-&gt;type() == QEvent::KeyRelease || %1-&gt;type() == QEvent::ShortcutOverride">
<add-function signature="operator!=(QKeySequence::StandardKey)">
- <inject-code class="target">
- bool ret = !(&amp;%CPPSELF == %1);
- %PYARG_0 = %CONVERTTOPYTHON[bool](ret);
- </inject-code>
+ <inject-code class="target" file="../glue/qtgui.cpp" snippet="qkeyevent-operatornotequal"/>
</add-function>
</object-type>
<object-type name="QMouseEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::MouseButtonDblClick || %1-&gt;type() == QEvent::MouseButtonPress || %1-&gt;type() == QEvent::MouseButtonRelease || %1-&gt;type() == QEvent::MouseMove"/>
@@ -1860,13 +1566,13 @@
<!-- ### -->
<add-function signature="__iter__()" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="__iter__" />
+ <insert-template name="__iter__"/>
</inject-code>
</add-function>
<add-function signature="__next__()" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="__next__">
- <replace from="%CPPSELF_TYPE" to="QTextFrame::iterator" />
+ <replace from="%CPPSELF_TYPE" to="QTextFrame::iterator"/>
</insert-template>
</inject-code>
</add-function>
@@ -1874,7 +1580,7 @@
<add-function signature="__iter__()" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="__iter_parent__">
- <replace from="%CPPSELF_TYPE" to="QTextFrame::iterator" />
+ <replace from="%CPPSELF_TYPE" to="QTextFrame::iterator"/>
</insert-template>
</inject-code>
</add-function>
@@ -1884,7 +1590,7 @@
<include file-name="QRect" location="global"/>
</extra-includes>
<enum-type name="ImageOption"/>
- <enum-type name="Transformation" flags="Transformations" since="5.5" />
+ <enum-type name="Transformation" flags="Transformations" since="5.5"/>
<modify-function signature="setDevice(QIODevice*)">
<modify-argument index="1">
<parent index="this" action="add"/>
@@ -1903,7 +1609,7 @@
<enum-type name="ImageReaderError"/>
<!-- ### This method does not make sense in Python.
Update: perhaps it does, but no one is missing it. -->
- <modify-function signature="read(QImage*)" remove="all" />
+ <modify-function signature="read(QImage*)" remove="all"/>
<modify-function signature="setDevice(QIODevice*)">
<modify-argument index="1">
<parent index="this" action="add"/>
@@ -1964,170 +1670,135 @@
</extra-includes>
<modify-function signature="takeItem(int,int)">
<modify-argument index="return">
- <parent index="this" action="remove" />
+ <parent index="this" action="remove"/>
</modify-argument>
</modify-function>
<modify-function signature="takeHorizontalHeaderItem(int)">
<modify-argument index="return">
- <parent index="this" action="remove" />
+ <parent index="this" action="remove"/>
</modify-argument>
</modify-function>
<modify-function signature="takeVerticalHeaderItem(int)">
<modify-argument index="return">
- <parent index="this" action="remove" />
+ <parent index="this" action="remove"/>
</modify-argument>
</modify-function>
<modify-function signature="verticalHeaderItem(int)const">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="horizontalHeaderItem(int)const">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="invisibleRootItem()const">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="item(int,int)const">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="itemFromIndex(const QModelIndex&amp;)const">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="itemPrototype()const">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="appendRow(const QList&lt;QStandardItem*&gt;&amp;)">
<modify-argument index="1">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="appendRow(QStandardItem*)">
<modify-argument index="1">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="insertRow(int,QStandardItem*)">
<modify-argument index="2">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="setHorizontalHeaderItem(int,QStandardItem*)">
<modify-argument index="2">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="setItem(int,int,QStandardItem*)">
- <inject-code class="target" position="beginning">
- // Clear parent from the old child
- QStandardItem *_i = %CPPSELF->item(%1, %2);
- if (_i) {
- PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
- Shiboken::Object::setParent(0, _pyI);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qstandarditemmodel-setitem-1"/>
<modify-argument index="3">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="setItem(int,QStandardItem*)">
- <inject-code class="target" position="beginning">
- // Clear parent from the old child
- QStandardItem *_i = %CPPSELF->item(%1);
- if (_i) {
- PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
- Shiboken::Object::setParent(0, _pyI);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qstandarditemmodel-setitem-2"/>
<modify-argument index="2">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="setItemPrototype(const QStandardItem*)">
<modify-argument index="1">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="setVerticalHeaderItem(int,QStandardItem*)">
- <inject-code class="target" position="beginning">
- // Clear parent from the old child
- QStandardItem *_i = %CPPSELF->verticalHeaderItem(%1);
- if (_i) {
- PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
- Shiboken::Object::setParent(0, _pyI);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qstandarditemmodel-setverticalheaderitem"/>
<modify-argument index="2">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="takeColumn(int)">
<modify-argument index="return">
- <parent index="this" action="remove" />
+ <parent index="this" action="remove"/>
</modify-argument>
</modify-function>
<modify-function signature="takeRow(int)">
<modify-argument index="return">
- <parent index="this" action="remove" />
+ <parent index="this" action="remove"/>
</modify-argument>
</modify-function>
<modify-function signature="findItems(const QString&amp;,QFlags&lt;Qt::MatchFlag&gt;,int)const">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="insertColumn(int,const QList&lt;QStandardItem*&gt;&amp;)">
<modify-argument index="2">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="insertRow(int,const QList&lt;QStandardItem*&gt;&amp;)">
<modify-argument index="2">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="appendColumn(const QList&lt;QStandardItem*&gt;&amp;)">
<modify-argument index="1">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="clear()">
- <inject-code class="target" position="beginning">
- Shiboken::BindingManager &amp;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 &lt; r_max; r++) {
- QList&lt;QStandardItem *&gt; ri = %CPPSELF.takeRow(0);
-
- PyObject *pyResult = %CONVERTTOPYTHON[QList&lt;QStandardItem * &gt;](ri);
- Shiboken::Object::setParent(Py_None, pyResult);
- Py_XDECREF(pyResult);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qstandarditemmodel-clear"/>
</modify-function>
</object-type>
<object-type name="QClipboard">
@@ -2135,7 +1806,7 @@
<include file-name="QImage" location="global"/>
<include file-name="QPixmap" location="global"/>
</extra-includes>
- <enum-type name="Mode" />
+ <enum-type name="Mode"/>
<modify-function signature="setMimeData(QMimeData*,QClipboard::Mode)">
<modify-argument index="1">
<!-- TODO: maybe this is not the best solution -->
@@ -2149,14 +1820,7 @@
<modify-argument index="return">
<replace-type modified-type="(retval, subtype)"/>
</modify-argument>
- <inject-code class="target" position="end">
- %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));
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtgui.cpp" snippet="qclipboard-text"/>
</modify-function>
</object-type>
<object-type name="QPaintEngineState">
@@ -2203,9 +1867,9 @@
<parent index="this" action="add"/>
</modify-argument>
</modify-function>
- <modify-function signature="print(QPagedPaintDevice*)const" rename="print_" />
+ <modify-function signature="print(QPagedPaintDevice*)const" rename="print_"/>
</object-type>
- <object-type name="QTextDocumentWriter" since="4.5" />
+ <object-type name="QTextDocumentWriter" since="4.5"/>
<object-type name="QTextTable">
<extra-includes>
<include file-name="QTextCursor" location="global"/>
@@ -2252,64 +1916,56 @@
%END_ALLOW_THREADS
</template>
- <modify-function signature="drawConvexPolygon(const QPoint*,int)" remove="all" />
+ <modify-function signature="drawConvexPolygon(const QPoint*,int)" remove="all"/>
<add-function signature="drawConvexPolygon(QVector&lt;QPoint>)">
<inject-code>
- <insert-template name="qpainter_drawlist" />
+ <insert-template name="qpainter_drawlist"/>
</inject-code>
</add-function>
- <modify-function signature="drawConvexPolygon(const QPointF*,int)" remove="all" />
+ <modify-function signature="drawConvexPolygon(const QPointF*,int)" remove="all"/>
<add-function signature="drawConvexPolygon(QVector&lt;QPointF>)">
<inject-code>
- <insert-template name="qpainter_drawlist" />
+ <insert-template name="qpainter_drawlist"/>
</inject-code>
</add-function>
<!-- ### Overloads using QVector<T> does the job of these methods -->
- <modify-function signature="drawLines(const QLine*,int)" remove="all" />
- <modify-function signature="drawLines(const QLineF*,int)" remove="all" />
- <modify-function signature="drawLines(const QPoint*,int)" remove="all" />
- <modify-function signature="drawLines(const QPointF*,int)" remove="all" />
- <modify-function signature="drawRects(const QRect*,int)" remove="all" />
- <modify-function signature="drawRects(const QRectF*,int)" remove="all" />
+ <modify-function signature="drawLines(const QLine*,int)" remove="all"/>
+ <modify-function signature="drawLines(const QLineF*,int)" remove="all"/>
+ <modify-function signature="drawLines(const QPoint*,int)" remove="all"/>
+ <modify-function signature="drawLines(const QPointF*,int)" remove="all"/>
+ <modify-function signature="drawRects(const QRect*,int)" remove="all"/>
+ <modify-function signature="drawRects(const QRectF*,int)" remove="all"/>
<!-- ### -->
- <modify-function signature="drawPoints(const QPoint*,int)" remove="all" />
+ <modify-function signature="drawPoints(const QPoint*,int)" remove="all"/>
<add-function signature="drawPoints(QVector&lt;QPoint>)">
<inject-code>
- <insert-template name="qpainter_drawlist" />
+ <insert-template name="qpainter_drawlist"/>
</inject-code>
</add-function>
- <modify-function signature="drawPoints(const QPointF*,int)" remove="all" />
+ <modify-function signature="drawPoints(const QPointF*,int)" remove="all"/>
<add-function signature="drawPoints(QVector&lt;QPointF>)">
<inject-code>
- <insert-template name="qpainter_drawlist" />
+ <insert-template name="qpainter_drawlist"/>
</inject-code>
</add-function>
- <modify-function signature="drawPolygon(const QPoint*,int,Qt::FillRule)" remove="all" />
+ <modify-function signature="drawPolygon(const QPoint*,int,Qt::FillRule)" remove="all"/>
<add-function signature="drawPolygon(QVector&lt;QPoint>,Qt::FillRule)">
- <inject-code>
- %BEGIN_ALLOW_THREADS
- %CPPSELF.%FUNCTION_NAME(%1.data(), %1.size(), %2);
- %END_ALLOW_THREADS
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qpainter-drawpolygon"/>
</add-function>
- <modify-function signature="drawPolygon(const QPointF*,int,Qt::FillRule)" remove="all" />
+ <modify-function signature="drawPolygon(const QPointF*,int,Qt::FillRule)" remove="all"/>
<add-function signature="drawPolygon(QVector&lt;QPointF>,Qt::FillRule)">
- <inject-code>
- %BEGIN_ALLOW_THREADS
- %CPPSELF.%FUNCTION_NAME(%1.data(), %1.size(), %2);
- %END_ALLOW_THREADS
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qpainter-drawpolygon"/>
</add-function>
- <modify-function signature="drawPolyline(const QPoint*,int)" remove="all" />
+ <modify-function signature="drawPolyline(const QPoint*,int)" remove="all"/>
<add-function signature="drawPolyline(QVector&lt;QPoint>)">
<inject-code>
- <insert-template name="qpainter_drawlist" />
+ <insert-template name="qpainter_drawlist"/>
</inject-code>
</add-function>
- <modify-function signature="drawPolyline(const QPointF*,int)" remove="all" />
+ <modify-function signature="drawPolyline(const QPointF*,int)" remove="all"/>
<add-function signature="drawPolyline(QVector&lt;QPointF>)">
<inject-code>
- <insert-template name="qpainter_drawlist" />
+ <insert-template name="qpainter_drawlist"/>
</inject-code>
</add-function>
<modify-function signature="drawRoundRect(int,int,int,int,int,int)">
@@ -2389,8 +2045,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="4" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="4"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2398,22 +2054,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="4" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="4"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix2x2(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="4" />
+ <replace from="%SIZE" to="4"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="4" />
+ <replace from="%MATRIX_SIZE" to="4"/>
</insert-template>
</inject-code>
</add-function>
@@ -2427,8 +2083,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="6" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="6"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2436,22 +2092,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="6" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="6"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix2x3(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="6" />
+ <replace from="%SIZE" to="6"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="6" />
+ <replace from="%MATRIX_SIZE" to="6"/>
</insert-template>
</inject-code>
</add-function>
@@ -2465,8 +2121,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="8" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="8"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2474,22 +2130,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="8" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="8"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix2x4(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="8" />
+ <replace from="%SIZE" to="8"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="8" />
+ <replace from="%MATRIX_SIZE" to="8"/>
</insert-template>
</inject-code>
</add-function>
@@ -2503,8 +2159,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="6" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="6"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2512,22 +2168,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="6" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="6"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix3x2(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="6" />
+ <replace from="%SIZE" to="6"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="6" />
+ <replace from="%MATRIX_SIZE" to="6"/>
</insert-template>
</inject-code>
</add-function>
@@ -2541,8 +2197,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="9" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="9"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2550,22 +2206,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="9" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="9"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix3x3(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="9" />
+ <replace from="%SIZE" to="9"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="9" />
+ <replace from="%MATRIX_SIZE" to="9"/>
</insert-template>
</inject-code>
</add-function>
@@ -2579,8 +2235,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="12" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="12"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2588,22 +2244,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="12" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="12"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix3x4(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="12" />
+ <replace from="%SIZE" to="12"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="12" />
+ <replace from="%MATRIX_SIZE" to="12"/>
</insert-template>
</inject-code>
</add-function>
@@ -2616,8 +2272,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="8" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="8"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2625,22 +2281,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="8" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="8"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix4x2(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="8" />
+ <replace from="%SIZE" to="8"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="8" />
+ <replace from="%MATRIX_SIZE" to="8"/>
</insert-template>
</inject-code>
</add-function>
@@ -2654,8 +2310,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="12" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="12"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2663,22 +2319,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="12" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="12"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix4x3(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="12" />
+ <replace from="%SIZE" to="12"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="12" />
+ <replace from="%MATRIX_SIZE" to="12"/>
</insert-template>
</inject-code>
</add-function>
@@ -2710,8 +2366,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="16" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="16"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2719,8 +2375,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="16" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="16"/>
</insert-template>
</inject-code>
</add-function>
@@ -2730,27 +2386,14 @@
<modify-function signature="QMatrix4x4(const float*)">
<modify-argument index="1">
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- if (PySequence_Size(%PYARG_1) == 16) {
- float values[16];
- for (int i=0; i &lt; 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]);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qmatrix4x4"/>
</modify-function>
<modify-function signature="data()">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="16" />
+ <replace from="%MATRIX_SIZE" to="16"/>
</insert-template>
</inject-code>
</modify-function>
@@ -2761,15 +2404,7 @@
<modify-argument index="return">
<replace-type modified-type="PyTupleObject*"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- float values[16];
- %CPPSELF.%FUNCTION_NAME(values);
- %PYARG_0 = PyTuple_New(16);
- for (int i = 0; i &lt; 16; i++) {
- PyObject *v = PyFloat_FromDouble(values[i]);
- PyTuple_SET_ITEM(%PYARG_0, i, v);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qmatrix4x4-copydatato"/>
</modify-function>
<modify-function signature="inverted(bool*)const">
@@ -2791,21 +2426,7 @@
<modify-function signature="operator()(int,int)const" remove="all"/>
<modify-function signature="operator()(int,int)" remove="all"/>
<add-function signature="__mgetitem__" return-type="PyObject*">
- <inject-code>
- 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;
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qmatrix4x4-mgetitem"/>
</add-function>
</value-type>
@@ -2815,8 +2436,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f, %f, %f" />
- <replace from="%REPR_ARGS" to="%CPPSELF.scalar(), %CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()" />
+ <replace from="%REPR_FORMAT" to="%f, %f, %f, %f"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.scalar(), %CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2824,16 +2445,16 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="dddd" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.scalar(), %CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()" />
+ <replace from="%REDUCE_FORMAT" to="dddd"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.scalar(), %CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()"/>
</insert-template>
</inject-code>
</add-function>
<!-- Qt5.5: XXX support the output variables! For now, I just suppressed the new methods. -->
- <modify-function signature="getAxisAndAngle(float*,float*,float*,float*)const" since="5.5" remove="all" />
- <modify-function signature="getAxisAndAngle(QVector3D*,float*)const" since="5.5" remove="all" />
- <modify-function signature="getEulerAngles(float*,float*,float*)const" since="5.5" remove="all" />
+ <modify-function signature="getAxisAndAngle(float*,float*,float*,float*)const" since="5.5" remove="all"/>
+ <modify-function signature="getAxisAndAngle(QVector3D*,float*)const" since="5.5" remove="all"/>
+ <modify-function signature="getEulerAngles(float*,float*,float*)const" since="5.5" remove="all"/>
</value-type>
<object-type name="QTouchEvent" since="4.6">
@@ -2843,16 +2464,16 @@
</object-type>
<object-type name="QTouchDevice">
- <enum-type name="CapabilityFlag" flags="Capabilities" />
- <enum-type name="DeviceType" />
+ <enum-type name="CapabilityFlag" flags="Capabilities"/>
+ <enum-type name="DeviceType"/>
</object-type>
<value-type name="QVector2D" since="4.6">
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f" />
- <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" />
+ <replace from="%REPR_FORMAT" to="%f, %f"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2860,8 +2481,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="dd" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" />
+ <replace from="%REDUCE_FORMAT" to="dd"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2869,8 +2490,8 @@
<add-function signature="toTuple" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="to_tuple">
- <replace from="%TT_FORMAT" to="dd" />
- <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" />
+ <replace from="%TT_FORMAT" to="dd"/>
+ <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2883,8 +2504,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f, %f" />
- <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()" />
+ <replace from="%REPR_FORMAT" to="%f, %f, %f"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2892,8 +2513,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="ddd" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()" />
+ <replace from="%REDUCE_FORMAT" to="ddd"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2901,8 +2522,8 @@
<add-function signature="toTuple" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="to_tuple">
- <replace from="%TT_FORMAT" to="ddd" />
- <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()" />
+ <replace from="%TT_FORMAT" to="ddd"/>
+ <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2915,8 +2536,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f, %f, %f" />
- <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()" />
+ <replace from="%REPR_FORMAT" to="%f, %f, %f, %f"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2924,8 +2545,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="dddd" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()" />
+ <replace from="%REDUCE_FORMAT" to="dddd"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2933,8 +2554,8 @@
<add-function signature="toTuple" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="to_tuple">
- <replace from="%TT_FORMAT" to="dddd" />
- <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()" />
+ <replace from="%TT_FORMAT" to="dddd"/>
+ <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2960,7 +2581,7 @@
</object-type>
<!-- This enum is present on QtCore -->
- <suppress-warning text="enum 'QCoreApplication::ApplicationFlags' is specified in typesystem, but not declared" />
+ <suppress-warning text="enum 'QCoreApplication::ApplicationFlags' is specified in typesystem, but not declared"/>
<!-- Qt5: here the new QWindow stuff and what it pulls in -->
<object-type name="QBackingStore"/>
@@ -2986,7 +2607,7 @@
<object-type name="QWindow" delete-in-main-thread="true">
<enum-type name="AncestorMode"/>
<enum-type name="Visibility"/>
- <modify-function signature="raise()" rename="raise_" />
+ <modify-function signature="raise()" rename="raise_"/>
<!-- see QWidget::nativeEvent(), QAbstractNativeEventFilter::nativeEventFilter() -->
<modify-function signature="nativeEvent(const QByteArray &amp;,void*,long*)">
<modify-argument index="3">
@@ -3016,32 +2637,25 @@
<include file-name="QIcon" location="global"/>
<include file-name="QLocale" location="global"/>
</extra-includes>
- <modify-function signature="QGuiApplication(int&amp;,char**,int)" access="private" />
+ <modify-function signature="QGuiApplication(int&amp;,char**,int)" access="private"/>
<add-function signature="QGuiApplication(QStringList)">
- <inject-code>
- QGuiApplicationConstructor(%PYSELF, args, &amp;%0);
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qguiapplication-1"/>
</add-function>
<add-function signature="QGuiApplication()">
- <inject-code>
- PyObject *empty = PyTuple_New(2);
- if (!PyTuple_SetItem(empty, 0, PyList_New(0))) {
- QGuiApplicationConstructor(%PYSELF, empty, &amp;%0);
- }
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qguiapplication-2"/>
</add-function>
- <inject-code class="native" file="glue/qguiapplication_init.cpp" position="beginning" />
+ <inject-code class="native" file="glue/qguiapplication_init.cpp" position="beginning"/>
</object-type>
<object-type name="QOpenGLBuffer" since="5.0">
- <enum-type name="Access" />
- <enum-type name="RangeAccessFlag" flags="RangeAccessFlags" />
- <enum-type name="Type" />
- <enum-type name="UsagePattern" />
+ <enum-type name="Access"/>
+ <enum-type name="RangeAccessFlag" flags="RangeAccessFlags"/>
+ <enum-type name="Type"/>
+ <enum-type name="UsagePattern"/>
</object-type>
<object-type name="QOpenGLContext">
- <enum-type name="OpenGLModuleType" />
+ <enum-type name="OpenGLModuleType"/>
</object-type>
<object-type name="QOpenGLContextGroup" since="5.0"/>
<object-type name="QOpenGLDebugLogger" since="5.1">
@@ -3053,7 +2667,7 @@
<enum-type name="Severity" flags="Severities"/>
</value-type>
<object-type name="QOpenGLFramebufferObject" since="5.0">
- <enum-type name="Attachment" />
+ <enum-type name="Attachment"/>
<enum-type name="FramebufferRestorePolicy" since="5.7"/>
</object-type>
<value-type name="QOpenGLFramebufferObjectFormat"/>
@@ -3271,7 +2885,7 @@
</modify-function>
<modify-function signature="glGetStringi(unsigned int,unsigned int)">
<modify-argument index="return">
- <replace-type modified-type="QString" />
+ <replace-type modified-type="QString"/>
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="glGetString_return_QString"/>
@@ -3332,7 +2946,7 @@
</modify-function>
<modify-function signature="glGetString(unsigned int)">
<modify-argument index="return">
- <replace-type modified-type="QString" />
+ <replace-type modified-type="QString"/>
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="glGetString_return_QString"/>
@@ -3371,7 +2985,7 @@
-->
<value-type name="QOpenGLPixelTransferOptions"/>
<object-type name="QOpenGLShader" since="5.0">
- <enum-type name="ShaderTypeBit" flags="ShaderType" />
+ <enum-type name="ShaderTypeBit" flags="ShaderType"/>
</object-type>
<object-type name="QOpenGLShaderProgram" since="5.0">
<modify-function signature="setAttributeArray(int,const float*,int,int)">
@@ -3470,7 +3084,7 @@
<modify-function signature="glyphIndexesForChars(const QChar*,int,quint32*,int*)const" remove="all"/>
</value-type>
<object-type name="QRasterWindow"/>
- <object-type name="QScreen" />
+ <object-type name="QScreen"/>
<object-type name="QStyleHints"/>
</typesystem>
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 @@
<primitive-type name="Qt::HANDLE" target-lang-api-name="PyObject"/>
- <suppress-warning text="enum 'QSysInfo::Endian' is specified in typesystem, but not declared" />
- <suppress-warning text="type 'QGtkStyle' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+ <suppress-warning text="enum 'QSysInfo::Endian' is specified in typesystem, but not declared"/>
+ <suppress-warning text="type 'QGtkStyle' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
</typesystem>
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 @@
-->
<typesystem package="PySide2.QtHelp">
- <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no" />
+ <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
<value-type name="QHelpContentItem">
<modify-function signature="parent()const">
@@ -52,7 +52,7 @@
</value-type>
<object-type name="QHelpContentModel" polymorphic-id-expression="qobject_cast&lt;QHelpContentModel*&gt;(%1)"/>
<object-type name="QHelpContentWidget"/>
- <object-type name="QHelpEngine" />
+ <object-type name="QHelpEngine"/>
<object-type name="QHelpEngineCore"/>
<object-type name="QHelpIndexModel"/>
<object-type name="QHelpIndexWidget"/>
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 @@
****************************************************************************/
-->
<typesystem package="PySide2.QtMultimedia">
- <load-typesystem name="QtCore/typesystem_core.xml" generate="no" />
- <load-typesystem name="QtGui/typesystem_gui.xml" generate="no" />
- <load-typesystem name="QtNetwork/typesystem_network.xml" generate="no" />
+ <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
+ <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
+ <load-typesystem name="QtNetwork/typesystem_network.xml" generate="no"/>
<namespace-type name="QAudio">
<enum-type name="Error"/>
@@ -177,25 +177,15 @@
<enum-type name="Status"/>
<modify-function signature="setViewfinder(QVideoWidget*)">
<modify-argument index="1">
- <replace-type modified-type="QObject *" />
+ <replace-type modified-type="QObject *"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- %BEGIN_ALLOW_THREADS
- QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1);
- %CPPSELF.%FUNCTION_NAME(reinterpret_cast&lt; %ARG1_TYPE &gt;(upcastedArg));
- %END_ALLOW_THREADS
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtmultimedia.cpp" snippet="upcast"/>
</modify-function>
<modify-function signature="setViewfinder(QGraphicsVideoItem*)">
<modify-argument index="1">
- <replace-type modified-type="QObject *" />
+ <replace-type modified-type="QObject *"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- %BEGIN_ALLOW_THREADS
- QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1);
- %CPPSELF.%FUNCTION_NAME(reinterpret_cast&lt; %ARG1_TYPE &gt;(upcastedArg));
- %END_ALLOW_THREADS
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtmultimedia.cpp" snippet="upcast"/>
</modify-function>
</object-type>
<object-type name="QCameraCaptureBufferFormatControl"/>
@@ -282,36 +272,21 @@
<enum-type name="Error"/>
<modify-function signature="setVideoOutput(QVideoWidget*)">
<modify-argument index="1">
- <replace-type modified-type="QObject *" />
+ <replace-type modified-type="QObject *"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- %BEGIN_ALLOW_THREADS
- QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1);
- %CPPSELF.%FUNCTION_NAME(reinterpret_cast&lt; %ARG1_TYPE &gt;(upcastedArg));
- %END_ALLOW_THREADS
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtmultimedia.cpp" snippet="upcast"/>
</modify-function>
<modify-function signature="setVideoOutput(QGraphicsVideoItem*)">
<modify-argument index="1">
- <replace-type modified-type="QObject *" />
+ <replace-type modified-type="QObject *"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- %BEGIN_ALLOW_THREADS
- QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1);
- %CPPSELF.%FUNCTION_NAME(reinterpret_cast&lt; %ARG1_TYPE &gt;(upcastedArg));
- %END_ALLOW_THREADS
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtmultimedia.cpp" snippet="upcast"/>
</modify-function>
<modify-function signature="setVideoOutput(QAbstractVideoSurface*)">
<modify-argument index="1">
- <replace-type modified-type="QObject *" />
+ <replace-type modified-type="QObject *"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- %BEGIN_ALLOW_THREADS
- QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1);
- %CPPSELF.%FUNCTION_NAME(reinterpret_cast&lt; %ARG1_TYPE &gt;(upcastedArg));
- %END_ALLOW_THREADS
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtmultimedia.cpp" snippet="upcast"/>
</modify-function>
</object-type>
<object-type name="QMediaPlayerControl"/>
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 @@
****************************************************************************/
-->
<typesystem package="PySide2.QtMultimediaWidgets">
- <load-typesystem name="QtCore/typesystem_core.xml" generate="no" />
- <load-typesystem name="QtGui/typesystem_gui.xml" generate="no" />
- <load-typesystem name="QtMultimedia/typesystem_multimedia_common.xml" generate="no" />
- <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no" />
+ <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
+ <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
+ <load-typesystem name="QtMultimedia/typesystem_multimedia_common.xml" generate="no"/>
+ <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
<object-type name="QCameraViewfinder"/>
<object-type name="QGraphicsVideoItem"/>
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 @@
<enum-type name="EncodingFormat"/>
<enum-type name="KeyAlgorithm"/>
<enum-type name="KeyType"/>
- <enum-type name="SslOption" flags="SslOptions" />
+ <enum-type name="SslOption" flags="SslOptions"/>
<enum-type name="SslProtocol"/>
<extra-includes>
<include file-name="qssl.h" location="global"/>
@@ -65,18 +65,18 @@
<rejection class="QIPv6Address" field-name="c"/>
<object-type name="QAbstractSocket">
- <enum-type name="BindFlag" flags="BindMode" />
+ <enum-type name="BindFlag" flags="BindMode"/>
<enum-type name="NetworkLayerProtocol"/>
- <enum-type name="PauseMode" flags="PauseModes" />
+ <enum-type name="PauseMode" flags="PauseModes"/>
<enum-type name="SocketError"/>
<enum-type name="SocketOption" since="4.6"/>
<enum-type name="SocketState"/>
<enum-type name="SocketType"/>
- <modify-function signature="connectToHost(const QString&amp;,quint16,QFlags&lt;QIODevice::OpenModeFlag>,QAbstractSocket::NetworkLayerProtocol)" allow-thread="yes" />
- <modify-function signature="connectToHost(const QHostAddress&amp;,quint16,QFlags&lt;QIODevice::OpenModeFlag>)" allow-thread="yes" />
- <modify-function signature="disconnectFromHost()" allow-thread="yes" />
- <modify-function signature="waitForConnected(int)" allow-thread="yes" />
- <modify-function signature="waitForDisconnected(int)" allow-thread="yes" />
+ <modify-function signature="connectToHost(const QString&amp;,quint16,QFlags&lt;QIODevice::OpenModeFlag>,QAbstractSocket::NetworkLayerProtocol)" allow-thread="yes"/>
+ <modify-function signature="connectToHost(const QHostAddress&amp;,quint16,QFlags&lt;QIODevice::OpenModeFlag>)" allow-thread="yes"/>
+ <modify-function signature="disconnectFromHost()" allow-thread="yes"/>
+ <modify-function signature="waitForConnected(int)" allow-thread="yes"/>
+ <modify-function signature="waitForDisconnected(int)" allow-thread="yes"/>
</object-type>
<value-type name="QDnsDomainNameRecord"/>
@@ -135,19 +135,7 @@
<modify-argument index="return">
<replace-type modified-type="(data, address, port)"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- Shiboken::AutoArrayPointer&lt;char&gt; data(%ARGUMENT_NAMES);
- QHostAddress ha;
- quint16 port;
- %BEGIN_ALLOW_THREADS
- %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(data, %ARGUMENT_NAMES, &amp;ha, &amp;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));
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtnetwork.cpp" snippet="qudpsocket-readdatagram"/>
</modify-function>
<modify-function signature="writeDatagram(const QByteArray&amp;,const QHostAddress&amp;,quint16)" allow-thread="yes"/>
<!-- ### writeDatagram(QByteArray, ...) does the trick -->
@@ -156,7 +144,7 @@
</object-type>
<object-type name="QLocalServer">
- <enum-type name="SocketOption" flags="SocketOptions" />
+ <enum-type name="SocketOption" flags="SocketOptions"/>
<modify-function signature="waitForNewConnection(int,bool*)" allow-thread="yes">
<!-- FIXME -->
<modify-argument index="1">
@@ -193,7 +181,7 @@
<modify-function signature="post(const QNetworkRequest &amp;,const QByteArray &amp;)" allow-thread="yes"/>
<modify-function signature="put(const QNetworkRequest &amp;,QIODevice*)" allow-thread="yes"/>
<modify-function signature="put(const QNetworkRequest &amp;,const QByteArray &amp;)" allow-thread="yes"/>
- <modify-function signature="sendCustomRequest(const QNetworkRequest &amp;,const QByteArray &amp;,QIODevice*)" allow-thread="yes" since="4.7" />
+ <modify-function signature="sendCustomRequest(const QNetworkRequest &amp;,const QByteArray &amp;,QIODevice*)" allow-thread="yes" since="4.7"/>
<modify-function signature="setCookieJar(QNetworkCookieJar*)">
<modify-argument index="1">
<define-ownership class="target" owner="c++"/>
@@ -210,11 +198,11 @@
<enum-type name="ConversionModeFlag" flags="ConversionMode" since="5.8"/>
<enum-type name="SpecialAddress"/>
<!-- ### QHostAddress(QIPv6Address) does this -->
- <modify-function signature="QHostAddress(quint8*)" remove="all" />
- <modify-function signature="QHostAddress(const quint8*)" remove="all" />
+ <modify-function signature="QHostAddress(quint8*)" remove="all"/>
+ <modify-function signature="QHostAddress(const quint8*)" remove="all"/>
<!-- ### -->
- <modify-function signature="setAddress(quint8*)" remove="all" />
- <modify-function signature="setAddress(const quint8*)" remove="all" />
+ <modify-function signature="setAddress(quint8*)" remove="all"/>
+ <modify-function signature="setAddress(const quint8*)" remove="all"/>
</value-type>
<value-type name="QHostInfo">
@@ -232,55 +220,28 @@
</value-type>
<value-type name="QNetworkProxy">
- <enum-type name="Capability" flags="Capabilities" />
+ <enum-type name="Capability" flags="Capabilities"/>
<enum-type name="ProxyType"/>
</value-type>
- <object-type name="QNetworkProxyFactory" />
+ <object-type name="QNetworkProxyFactory"/>
<value-type name="QNetworkProxyQuery">
- <enum-type name="QueryType" />
+ <enum-type name="QueryType"/>
</value-type>
<value-type name="QIPv6Address">
<add-function signature="__len__">
- <inject-code class="target" position="beginning">
- return 16;
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtnetwork.cpp" snippet="qipv6address-len"/>
</add-function>
<add-function signature="__getitem__">
- <inject-code class="target" position="beginning">
- if (_i >= 16) {
- PyErr_SetString(PyExc_IndexError, "index out of bounds");
- return 0;
- }
- if (_i &lt; 0)
- _i = 16 - qAbs(_i);
-
- uint item = %CPPSELF.c[_i];
- return %CONVERTTOPYTHON[uint](item);
- </inject-code>
- </add-function>
- <add-function signature="__len__">
- <inject-code class="target" position="beginning">
- return 16;
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtnetwork.cpp" snippet="qipv6address-getitem"/>
</add-function>
<add-function signature="__setitem__">
- <inject-code class="target" position="beginning">
- if (_i >= 16) {
- PyErr_SetString(PyExc_IndexError, "index out of bounds");
- return -1;
- }
- if (_i &lt; 0)
- _i = 16 - qAbs(_i);
- quint8 item = %CONVERTTOCPP[quint8](_value);
- %CPPSELF.c[_i] = item;
- return 0;
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtnetwork.cpp" snippet="qipv6address-setitem"/>
</add-function>
</value-type>
- <value-type name="QAuthenticator" />
+ <value-type name="QAuthenticator"/>
<value-type name="QNetworkCookie">
<enum-type name="RawForm"/>
<extra-includes>
@@ -297,7 +258,7 @@
</value-type>
<value-type name="QNetworkConfiguration" since="4.7">
- <enum-type name="BearerType" />
+ <enum-type name="BearerType"/>
<enum-type name="Purpose" since="4.7"/>
<enum-type name="StateFlag" flags="StateFlags" since="4.7"/>
<enum-type name="Type" since="4.7"/>
@@ -308,7 +269,7 @@
<object-type name="QNetworkSession" since="4.7">
<enum-type name="SessionError" since="4.7"/>
<enum-type name="State" since="4.7"/>
- <enum-type name="UsagePolicy" flags="UsagePolicies" />
+ <enum-type name="UsagePolicy" flags="UsagePolicies"/>
</object-type>
<object-type name="QAbstractNetworkCache"/>
@@ -328,7 +289,7 @@
<value-type name="QSslCipher"/>
<value-type name="QSslConfiguration">
- <enum-type name="NextProtocolNegotiationStatus" />
+ <enum-type name="NextProtocolNegotiationStatus"/>
</value-type>
<value-type name="QSslDiffieHellmanParameters" since="5.8">
@@ -347,8 +308,8 @@
<object-type name="QSslSocket">
<enum-type name="SslMode"/>
<enum-type name="PeerVerifyMode"/>
- <modify-function signature="connectToHostEncrypted(const QString&amp;,quint16,QFlags&lt;QIODevice::OpenModeFlag>,QAbstractSocket::NetworkLayerProtocol)" allow-thread="yes" />
- <modify-function signature="waitForEncrypted(int)" allow-thread="yes" />
+ <modify-function signature="connectToHostEncrypted(const QString&amp;,quint16,QFlags&lt;QIODevice::OpenModeFlag>,QAbstractSocket::NetworkLayerProtocol)" allow-thread="yes"/>
+ <modify-function signature="waitForEncrypted(int)" allow-thread="yes"/>
</object-type>
<value-type name="QSslPreSharedKeyAuthenticator"/>
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 @@
****************************************************************************/
-->
<typesystem package="PySide2.QtOpenGL">
- <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no" />
+ <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
<primitive-type name="GLbitfield"/>
<primitive-type name="GLboolean"/>
@@ -88,7 +88,7 @@
<enum-type name="OpenGLVersionFlag" flags="OpenGLVersionFlags"/>
</value-type>
- <rejection class="QGLContext" field-name="currentCtx" />
+ <rejection class="QGLContext" field-name="currentCtx"/>
<object-type name="QGLContext">
<enum-type name="BindOption" flags="BindOptions" since="4.6"/>
<modify-function signature="chooseContext(const QGLContext*)">
@@ -99,7 +99,7 @@
</modify-function>
<!-- ### Obsolete functions and ctors -->
- <modify-function signature="QGLContext(const QGLFormat&amp;,QPaintDevice*)" remove="all" />
+ <modify-function signature="QGLContext(const QGLFormat&amp;,QPaintDevice*)" remove="all"/>
<!-- ### -->
</object-type>
<object-type name="QGLFramebufferObject">
@@ -124,7 +124,7 @@
</modify-argument>
</modify-function>
<!-- ### Not part of Qt public API -->
- <modify-function signature="setContext(QGLContext*,const QGLContext*,bool)" remove="all" />
+ <modify-function signature="setContext(QGLContext*,const QGLContext*,bool)" remove="all"/>
<!-- ### -->
<!--- ### Obsolete functions -->
<modify-function signature="setFormat(QGLFormat)" remove="all"/>
@@ -158,12 +158,12 @@
<!-- setAttributeArray -->
<modify-function signature="setAttributeArray(int,const QVector2D*,int)" rename="setAttributeArray2D">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="%3" />
- <replace from="$ARG1" to="%3" />
+ <replace from="$ARG0" to="%3"/>
+ <replace from="$ARG1" to="%3"/>
<replace from="$ATTR_TYPE" to="QVector2D"/>
</insert-template>
</inject-code>
@@ -171,12 +171,12 @@
<modify-function signature="setAttributeArray(int,const QVector3D*,int)" rename="setAttributeArray3D">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="%3" />
- <replace from="$ARG1" to="%3" />
+ <replace from="$ARG0" to="%3"/>
+ <replace from="$ARG1" to="%3"/>
<replace from="$ATTR_TYPE" to="QVector3D"/>
</insert-template>
</inject-code>
@@ -184,12 +184,12 @@
<modify-function signature="setAttributeArray(int,const QVector4D*,int)" rename="setAttributeArray4D">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="%3" />
- <replace from="$ARG1" to="%3" />
+ <replace from="$ARG0" to="%3"/>
+ <replace from="$ARG1" to="%3"/>
<replace from="$ATTR_TYPE" to="QVector4D"/>
</insert-template>
</inject-code>
@@ -197,12 +197,12 @@
<modify-function signature="setAttributeArray(const char*,const QVector2D*,int)" rename="setAttributeArray2D">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="%3" />
- <replace from="$ARG1" to="%3" />
+ <replace from="$ARG0" to="%3"/>
+ <replace from="$ARG1" to="%3"/>
<replace from="$ATTR_TYPE" to="QVector2D"/>
</insert-template>
</inject-code>
@@ -210,12 +210,12 @@
<modify-function signature="setAttributeArray(const char*,const QVector3D*,int)" rename="setAttributeArray3D">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="%3" />
- <replace from="$ARG1" to="%3" />
+ <replace from="$ARG0" to="%3"/>
+ <replace from="$ARG1" to="%3"/>
<replace from="$ATTR_TYPE" to="QVector3D"/>
</insert-template>
</inject-code>
@@ -223,12 +223,12 @@
<modify-function signature="setAttributeArray(const char*,const QVector4D*,int)" rename="setAttributeArray4D">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="%3" />
- <replace from="$ARG1" to="%3" />
+ <replace from="$ARG0" to="%3"/>
+ <replace from="$ARG1" to="%3"/>
<replace from="$ATTR_TYPE" to="QVector4D"/>
</insert-template>
</inject-code>
@@ -237,15 +237,15 @@
<!-- setUniformValueArray -->
<modify-function signature="setUniformValueArray(int,const GLint*,int)" rename="setUniformValueArrayInt">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="GLint"/>
</insert-template>
</inject-code>
@@ -253,15 +253,15 @@
<modify-function signature="setUniformValueArray(int,const GLuint*,int)" rename="setUniformValueArrayUint">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="GLuint"/>
</insert-template>
</inject-code>
@@ -269,15 +269,15 @@
<modify-function signature="setUniformValueArray(int,const QVector2D*,int)" rename="setUniformValueArray2D">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QVector2D"/>
</insert-template>
</inject-code>
@@ -285,15 +285,15 @@
<modify-function signature="setUniformValueArray(int,const QVector3D*,int)" rename="setUniformValueArray3D">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QVector3D"/>
</insert-template>
</inject-code>
@@ -301,15 +301,15 @@
<modify-function signature="setUniformValueArray(int,const QVector4D*,int)" rename="setUniformValueArray4D">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QVector4D"/>
</insert-template>
</inject-code>
@@ -317,15 +317,15 @@
<modify-function signature="setUniformValueArray(int,const QMatrix2x2*,int)" rename="setUniformValueArray2x2">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix2x2"/>
</insert-template>
</inject-code>
@@ -333,15 +333,15 @@
<modify-function signature="setUniformValueArray(int,const QMatrix2x3*,int)" rename="setUniformValueArray2x3">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix2x3"/>
</insert-template>
</inject-code>
@@ -349,15 +349,15 @@
<modify-function signature="setUniformValueArray(int,const QMatrix2x4*,int)" rename="setUniformValueArray2x4">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix2x4"/>
</insert-template>
</inject-code>
@@ -365,15 +365,15 @@
<modify-function signature="setUniformValueArray(int,const QMatrix3x2*,int)" rename="setUniformValueArray3x2">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix3x2"/>
</insert-template>
</inject-code>
@@ -381,15 +381,15 @@
<modify-function signature="setUniformValueArray(int,const QMatrix3x3*,int)" rename="setUniformValueArray3x3">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix3x3"/>
</insert-template>
</inject-code>
@@ -397,15 +397,15 @@
<modify-function signature="setUniformValueArray(int,const QMatrix3x4*,int)" rename="setUniformValueArray3x4">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix3x4"/>
</insert-template>
</inject-code>
@@ -413,15 +413,15 @@
<modify-function signature="setUniformValueArray(int,const QMatrix4x2*,int)" rename="setUniformValueArray4x2">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix4x2"/>
</insert-template>
</inject-code>
@@ -429,15 +429,15 @@
<modify-function signature="setUniformValueArray(int,const QMatrix4x3*,int)" rename="setUniformValueArray4x3">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix4x3"/>
</insert-template>
</inject-code>
@@ -445,15 +445,15 @@
<modify-function signature="setUniformValueArray(int,const QMatrix4x4*,int)" rename="setUniformValueArray4x4">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix4x4"/>
</insert-template>
</inject-code>
@@ -461,15 +461,15 @@
<modify-function signature="setUniformValueArray(const char*,const GLint*,int)" rename="setUniformValueArrayInt">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="GLint"/>
</insert-template>
</inject-code>
@@ -477,15 +477,15 @@
<modify-function signature="setUniformValueArray(const char*,const GLuint*,int)" rename="setUniformValueArrayUint">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="GLuint"/>
</insert-template>
</inject-code>
@@ -493,15 +493,15 @@
<modify-function signature="setUniformValueArray(const char*,const QVector2D*,int)" rename="setUniformValueArray2D">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QVector2D"/>
</insert-template>
</inject-code>
@@ -509,15 +509,15 @@
<modify-function signature="setUniformValueArray(const char*,const QVector3D*,int)" rename="setUniformValueArray3D">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QVector3D"/>
</insert-template>
</inject-code>
@@ -525,15 +525,15 @@
<modify-function signature="setUniformValueArray(const char*,const QVector4D*,int)" rename="setUniformValueArray4D">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QVector4D"/>
</insert-template>
</inject-code>
@@ -541,15 +541,15 @@
<modify-function signature="setUniformValueArray(const char*,const QMatrix2x2*,int)" rename="setUniformValueArray2x2">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix2x2"/>
</insert-template>
</inject-code>
@@ -557,15 +557,15 @@
<modify-function signature="setUniformValueArray(const char*,const QMatrix2x3*,int)" rename="setUniformValueArray2x3">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix2x3"/>
</insert-template>
</inject-code>
@@ -573,15 +573,15 @@
<modify-function signature="setUniformValueArray(const char*,const QMatrix2x4*,int)" rename="setUniformValueArray2x4">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix2x4"/>
</insert-template>
</inject-code>
@@ -589,15 +589,15 @@
<modify-function signature="setUniformValueArray(const char*,const QMatrix3x2*,int)" rename="setUniformValueArray3x2">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix3x2"/>
</insert-template>
</inject-code>
@@ -605,15 +605,15 @@
<modify-function signature="setUniformValueArray(const char*,const QMatrix3x3*,int)" rename="setUniformValueArray3x3">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix3x3"/>
</insert-template>
</inject-code>
@@ -621,15 +621,15 @@
<modify-function signature="setUniformValueArray(const char*,const QMatrix3x4*,int)" rename="setUniformValueArray3x4">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix3x4"/>
</insert-template>
</inject-code>
@@ -637,15 +637,15 @@
<modify-function signature="setUniformValueArray(const char*,const QMatrix4x2*,int)" rename="setUniformValueArray4x2">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix4x2"/>
</insert-template>
</inject-code>
@@ -653,15 +653,15 @@
<modify-function signature="setUniformValueArray(const char*,const QMatrix4x3*,int)" rename="setUniformValueArray4x3">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix4x3"/>
</insert-template>
</inject-code>
@@ -669,23 +669,23 @@
<modify-function signature="setUniformValueArray(const char*,const QMatrix4x4*,int)" rename="setUniformValueArray4x4">
<modify-argument index="2" >
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
</modify-argument>
<inject-code>
<insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size" />
- <replace from="$ARG1" to="0" />
+ <replace from="$ARG0" to="_size"/>
+ <replace from="$ARG1" to="0"/>
<replace from="$ATTR_TYPE" to="QMatrix4x4"/>
</insert-template>
</inject-code>
</modify-function>
<!-- ### Use QMatrixZxY overloads -->
- <modify-function signature="setAttributeArray(int,GLenum,const void*,int,int)" remove="all" since="4.7" />
- <modify-function signature="setAttributeArray(const char*,GLenum,const void*,int,int)" remove="all" since="4.7" />
+ <modify-function signature="setAttributeArray(int,GLenum,const void*,int,int)" remove="all" since="4.7"/>
+ <modify-function signature="setAttributeArray(const char*,GLenum,const void*,int,int)" remove="all" since="4.7"/>
<!-- ### -->
</object-type>
@@ -701,25 +701,10 @@
<modify-argument index="2">
<replace-default-expression with="-1"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- int size = (%2 &lt; 0) ? %1.size() : %2;
- %CPPSELF.allocate((const void*) %1.data(), size);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtopengl.cpp" snippet="qglbuffer-allocate"/>
</modify-function>
<modify-function signature="map(QGLBuffer::Access)">
- <inject-code>
- 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);
- }
- </inject-code>
+ <inject-code file="../glue/qtopengl.cpp" snippet="qglbuffer-map"/>
</modify-function>
<modify-function signature="read(int,void*,int)">
<modify-argument index="2">
@@ -728,17 +713,7 @@
<modify-argument index="return">
<replace-type modified-type="(retval, data)"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- 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;
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtopengl.cpp" snippet="qglbuffer-read"/>
</modify-function>
<modify-function signature="write(int,const void*,int)">
<modify-argument index="2">
@@ -747,10 +722,7 @@
<modify-argument index="3">
<replace-default-expression with="-1"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- int size = (%3 &lt; 0) ? %2.size() : %3;
- %CPPSELF.write(%1, (const void*) %2.data(), size);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtopengl.cpp" snippet="qglbuffer-write"/>
</modify-function>
</object-type>
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 @@
****************************************************************************/
-->
<typesystem package="PySide2.QtPrintSupport">
- <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no" />
+ <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
<object-type name="QPageSetupDialog">
<modify-function signature="exec()" rename="exec_" allow-thread="yes"/>
</object-type>
<object-type name="QAbstractPrintDialog">
- <enum-type name="PrintDialogOption" flags="PrintDialogOptions" />
- <enum-type name="PrintRange" />
+ <enum-type name="PrintDialogOption" flags="PrintDialogOptions"/>
+ <enum-type name="PrintRange"/>
</object-type>
<object-type name="QPrintDialog">
- <modify-function signature="exec()" rename="exec_" allow-thread="yes" />
+ <modify-function signature="exec()" rename="exec_" allow-thread="yes"/>
</object-type>
<object-type name="QPrintEngine">
- <enum-type name="PrintEnginePropertyKey" />
+ <enum-type name="PrintEnginePropertyKey"/>
</object-type>
- <value-type name="QPrinterInfo" />
+ <value-type name="QPrinterInfo"/>
<rejection class="QPrinter" function-name="printerSelectionOption"/>
<rejection class="QPrinter" function-name="setPrinterSelectionOption"/>
@@ -74,7 +74,7 @@
<enum-type name="Unit"/>
<modify-function signature="getPageMargins(qreal*,qreal*,qreal*,qreal*,QPrinter::Unit)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -90,7 +90,7 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*,args">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
@@ -111,7 +111,7 @@
<object-type name="QPrintPreviewWidget">
<enum-type name="ViewMode"/>
<enum-type name="ZoomMode"/>
- <modify-function signature="print()" rename="print_" />
+ <modify-function signature="print()" rename="print_"/>
</object-type>
</typesystem>
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 @@
<load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
<!-- This is to inform the generator that the VolatileBool python type exists -->
- <custom-type name="VolatileBool" />
+ <custom-type name="VolatileBool"/>
<primitive-type name="bool volatile" target-lang-api-name="VolatileBool">
<include file-name="pysideqmlregistertype.h" location="local"/>
<!-- No conversion rules are specified here, because the generator does not handle
@@ -76,10 +76,7 @@
Note that it's perfectly reasonable for a library to register types to older versions than the actual version of the library. Indeed, it is normal for the new library to allow QML written to previous versions to continue to work, even if more advanced versions of some of its types are available.
</inject-documentation>
- <inject-code class="target">
- int %0 = PySide::qmlRegisterType(%ARGUMENT_NAMES);
- %PYARG_0 = %CONVERTTOPYTHON[int](%0);
- </inject-code>
+ <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistertype"/>
</add-function>
<enum-type identified-by-value="QML_HAS_ATTACHED_PROPERTIES">
@@ -89,38 +86,33 @@
</extra-includes>
</enum-type>
- <inject-code class="target" position="end">
- PySide::initQmlSupport(module);
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtqml.cpp" snippet="init"/>
<object-type name="QJSEngine">
- <enum-type name="Extension" flags="Extensions" since="5.6" />
+ <enum-type name="Extension" flags="Extensions" since="5.6"/>
<add-function signature="toScriptValue(const QVariant&amp;)" return-type="QJSValue">
- <inject-code class="target" position="end">
- %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1);
- return %CONVERTTOPYTHON[%RETURN_TYPE](retval);
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtqml.cpp" snippet="qjsengine-toscriptvalue"/>
</add-function>
</object-type>
<value-type name="QJSValue">
- <enum-type name="SpecialValue" />
+ <enum-type name="SpecialValue"/>
</value-type>
- <object-type name="QJSValueIterator" />
+ <object-type name="QJSValueIterator"/>
<object-type name="QQmlAbstractUrlInterceptor">
- <enum-type name="DataType" />
+ <enum-type name="DataType"/>
</object-type>
- <object-type name="QQmlApplicationEngine" />
+ <object-type name="QQmlApplicationEngine"/>
<object-type name="QQmlComponent">
- <enum-type name="CompilationMode" />
- <enum-type name="Status" />
+ <enum-type name="CompilationMode"/>
+ <enum-type name="Status"/>
</object-type>
- <object-type name="QQmlContext" />
- <value-type name="QQmlError" />
+ <object-type name="QQmlContext"/>
+ <value-type name="QQmlError"/>
<object-type name="QQmlDebuggingEnabler">
- <enum-type name="StartMode" />
+ <enum-type name="StartMode"/>
</object-type>
<object-type name="QQmlEngine">
- <enum-type name="ObjectOwnership" />
+ <enum-type name="ObjectOwnership"/>
<modify-function signature="addImageProvider(const QString&amp;,QQmlImageProviderBase*)">
<modify-argument index="2">
<define-ownership owner="c++"/>
@@ -133,35 +125,35 @@
<remove-argument />
</modify-argument>
<modify-argument index="return">
- <replace-type modified-type="PyTuple" />
+ <replace-type modified-type="PyTuple"/>
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_bool*"/>
</inject-code>
</modify-function>
</object-type>
- <interface-type name="QQmlTypesExtensionInterface" />
- <interface-type name="QQmlExtensionInterface" />
- <object-type name="QQmlExtensionPlugin" />
+ <interface-type name="QQmlTypesExtensionInterface"/>
+ <interface-type name="QQmlExtensionInterface"/>
+ <object-type name="QQmlExtensionPlugin"/>
<!-- Possible qRegisterMetaType issues ? -->
<object-type name="QQmlFile">
- <enum-type name="Status" />
+ <enum-type name="Status"/>
</object-type>
- <object-type name="QQmlFileSelector" />
+ <object-type name="QQmlFileSelector"/>
<object-type name="QQmlImageProviderBase">
- <enum-type name="Flag" flags="Flags" />
- <enum-type name="ImageType" />
+ <enum-type name="Flag" flags="Flags"/>
+ <enum-type name="ImageType"/>
</object-type>
<object-type name="QQmlIncubator">
- <enum-type name="IncubationMode" />
- <enum-type name="Status" />
+ <enum-type name="IncubationMode"/>
+ <enum-type name="Status"/>
</object-type>
<object-type name="QQmlIncubationController">
<modify-function signature="incubateWhile(volatile bool*,int)" allow-thread="yes">
<modify-argument index="1">
<!-- The replace type is needed to use the VolatileBool_Check macro instead of
a template conversion function with "volatile bool" as argument. -->
- <replace-type modified-type="VolatileBool" />
+ <replace-type modified-type="VolatileBool"/>
<conversion-rule class="native">
volatile bool * %out =
&amp;((reinterpret_cast&lt;QtQml_VolatileBoolObject *&gt;(%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.
- <value-type name="QQmlListProperty" />-->
- <value-type name="QQmlListReference" />
- <interface-type name="QQmlParserStatus" />
+ <value-type name="QQmlListProperty"/>-->
+ <value-type name="QQmlListReference"/>
+ <interface-type name="QQmlParserStatus"/>
<value-type name="QQmlProperty">
- <enum-type name="PropertyTypeCategory" />
- <enum-type name="Type" />
+ <enum-type name="PropertyTypeCategory"/>
+ <enum-type name="Type"/>
</value-type>
- <object-type name="QQmlPropertyMap" />
- <object-type name="QQmlPropertyValueSource" />
+ <object-type name="QQmlPropertyMap"/>
+ <object-type name="QQmlPropertyValueSource"/>
<value-type name="QQmlScriptString">
<modify-function signature="numberLiteral(bool*)const" allow-thread="yes">
<modify-argument index="1">
<remove-argument />
</modify-argument>
<modify-argument index="return">
- <replace-type modified-type="PyTuple" />
+ <replace-type modified-type="PyTuple"/>
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_bool*"/>
@@ -201,7 +193,7 @@
<remove-argument />
</modify-argument>
<modify-argument index="return">
- <replace-type modified-type="PyTuple" />
+ <replace-type modified-type="PyTuple"/>
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_bool*"/>
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 @@
<load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
<load-typesystem name="QtQml/typesystem_qml.xml" generate="no"/>
- <smart-pointer-type name="QSharedPointer" type="shared" getter="data" />
+ <smart-pointer-type name="QSharedPointer" type="shared" getter="data"/>
<extra-includes>
<include file-name="pysidequickregistertype.h" location="local"/>
</extra-includes>
- <inject-code class="target" position="end">
- PySide::initQuickSupport(module);
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtquick.cpp" snippet="qtquick"/>
- <object-type name="QQuickAsyncImageProvider" since="5.6" />
+ <object-type name="QQuickAsyncImageProvider" since="5.6"/>
- <object-type name="QQuickFramebufferObject" />
- <object-type name="QQuickFramebufferObject::Renderer" />
+ <object-type name="QQuickFramebufferObject"/>
+ <object-type name="QQuickFramebufferObject::Renderer"/>
- <object-type name="QQuickTextureFactory" />
- <object-type name="QQuickImageProvider" />
- <object-type name="QQuickImageResponse" since="5.6" />
+ <object-type name="QQuickTextureFactory"/>
+ <object-type name="QQuickImageProvider"/>
+ <object-type name="QQuickImageResponse" since="5.6"/>
- <object-type name="QQuickTransform" />
+ <object-type name="QQuickTransform"/>
<object-type name="QQuickItem" delete-in-main-thread="true">
- <value-type name="UpdatePaintNodeData" />
- <enum-type name="Flag" flags="Flags" />
- <enum-type name="ItemChange" />
- <enum-type name="TransformOrigin" />
+ <value-type name="UpdatePaintNodeData"/>
+ <enum-type name="Flag" flags="Flags"/>
+ <enum-type name="ItemChange"/>
+ <enum-type name="TransformOrigin"/>
<modify-function signature="itemTransform(QQuickItem*,bool*)const" allow-thread="yes">
<modify-argument index="2">
<remove-argument />
</modify-argument>
<modify-argument index="return">
- <replace-type modified-type="PyTuple" />
+ <replace-type modified-type="PyTuple"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="fix_args,bool*" />
+ <insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
<!-- TODO: Find a way to wrap `union ItemChangeData {}` -->
</object-type>
- <object-type name="QQuickItemGrabResult" />
+ <object-type name="QQuickItemGrabResult"/>
<object-type name="QQuickPaintedItem">
- <enum-type name="RenderTarget" />
- <enum-type name="PerformanceHint" flags="PerformanceHints" />
+ <enum-type name="RenderTarget"/>
+ <enum-type name="PerformanceHint" flags="PerformanceHints"/>
</object-type>
- <object-type name="QQuickRenderControl" />
+ <object-type name="QQuickRenderControl"/>
- <object-type name="QQuickTextDocument" />
+ <object-type name="QQuickTextDocument"/>
<object-type name="QQuickView">
- <enum-type name="ResizeMode" />
- <enum-type name="Status" />
+ <enum-type name="ResizeMode"/>
+ <enum-type name="Status"/>
</object-type>
<object-type name="QQuickWindow">
- <enum-type name="CreateTextureOption" flags="CreateTextureOptions" />
- <enum-type name="RenderStage" />
- <enum-type name="SceneGraphError" />
+ <enum-type name="CreateTextureOption" flags="CreateTextureOptions"/>
+ <enum-type name="RenderStage"/>
+ <enum-type name="SceneGraphError"/>
<enum-type name="TextRenderType" since="5.10"/>
</object-type>
<object-type name="QSGAbstractRenderer">
- <enum-type name="ClearModeBit" flags="ClearMode" />
+ <enum-type name="ClearModeBit" flags="ClearMode"/>
</object-type>
- <object-type name="QSGBasicGeometryNode" />
- <object-type name="QSGClipNode" />
- <object-type name="QSGDynamicTexture" />
+ <object-type name="QSGBasicGeometryNode"/>
+ <object-type name="QSGClipNode"/>
+ <object-type name="QSGDynamicTexture"/>
<object-type name="QSGEngine">
- <enum-type name="CreateTextureOption" flags="CreateTextureOptions" />
+ <enum-type name="CreateTextureOption" flags="CreateTextureOptions"/>
</object-type>
- <!-- <object-type name="QSGFlatColorMaterial" /> -->
+ <!-- <object-type name="QSGFlatColorMaterial"/> -->
<object-type name="QSGGeometry">
- <enum-type name="DataPattern" />
+ <enum-type name="DataPattern"/>
<enum-type name="AttributeType" since="5.8"/>
<enum-type name="DrawingMode" since="5.8"/>
<enum-type name="Type" since="5.8"/>
</object-type>
- <value-type name="QSGGeometry::Attribute" />
- <value-type name="QSGGeometry::AttributeSet" />
- <value-type name="QSGGeometry::ColoredPoint2D" />
- <value-type name="QSGGeometry::Point2D" />
- <value-type name="QSGGeometry::TexturedPoint2D" />
- <object-type name="QSGGeometryNode" />
+ <value-type name="QSGGeometry::Attribute"/>
+ <value-type name="QSGGeometry::AttributeSet"/>
+ <value-type name="QSGGeometry::ColoredPoint2D"/>
+ <value-type name="QSGGeometry::Point2D"/>
+ <value-type name="QSGGeometry::TexturedPoint2D"/>
+ <object-type name="QSGGeometryNode"/>
<!-- QSGMaterialShader doesn't compile because of const char * char * types not being recognized
by the C++ parser, nor the generator.
<object-type name="QSGMaterial">
- <enum-type name="Flag" flags="Flags" />
+ <enum-type name="Flag" flags="Flags"/>
</object-type>
- <object-type name="QSGMaterialShader" />
+ <object-type name="QSGMaterialShader"/>
<value-type name="QSGMaterialShader::RenderState">
- <enum-type name="DirtyState" flags="DirtyStates" />
+ <enum-type name="DirtyState" flags="DirtyStates"/>
</value-type>
-->
- <object-type name="QSGMaterialType" />
+ <object-type name="QSGMaterialType"/>
<object-type name="QSGNode">
- <enum-type name="DirtyStateBit" flags="DirtyState" />
- <enum-type name="Flag" flags="Flags" />
- <enum-type name="NodeType" />
+ <enum-type name="DirtyStateBit" flags="DirtyState"/>
+ <enum-type name="Flag" flags="Flags"/>
+ <enum-type name="NodeType"/>
</object-type>
- <object-type name="QSGOpacityNode" />
- <!-- <object-type name="QSGOpaqueTextureMaterial" /> -->
- <object-type name="QSGSimpleRectNode" />
+ <object-type name="QSGOpacityNode"/>
+ <!-- <object-type name="QSGOpaqueTextureMaterial"/> -->
+ <object-type name="QSGSimpleRectNode"/>
<object-type name="QSGSimpleTextureNode">
- <enum-type name="TextureCoordinatesTransformFlag" flags="TextureCoordinatesTransformMode" />
+ <enum-type name="TextureCoordinatesTransformFlag" flags="TextureCoordinatesTransformMode"/>
</object-type>
<object-type name="QSGTexture">
<enum-type name="AnisotropyLevel" since="5.9"/>
- <enum-type name="Filtering" />
- <enum-type name="WrapMode" />
+ <enum-type name="Filtering"/>
+ <enum-type name="WrapMode"/>
</object-type>
- <!-- <object-type name="QSGTextureMaterial" /> -->
- <object-type name="QSGTextureProvider" />
- <object-type name="QSGTransformNode" />
- <!-- <object-type name="QSGVertexColorMaterial" /> -->
+ <!-- <object-type name="QSGTextureMaterial"/> -->
+ <object-type name="QSGTextureProvider"/>
+ <object-type name="QSGTransformNode"/>
+ <!-- <object-type name="QSGVertexColorMaterial"/> -->
<!-- These currently don't work because they are template classes, and the generator chokes on
them. Making these work properly would require fixing the parsing of template classes,
allowing creation of State structures and passing them to the template classes, as well as
implementing some mechanism of registration of the custom template classes, kind of how
it's done for qt quick items.
- <object-type name="QSGSimpleMaterial" />
- <object-type name="QSGSimpleMaterialShader" />
+ <object-type name="QSGSimpleMaterial"/>
+ <object-type name="QSGSimpleMaterialShader"/>
-->
</typesystem>
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 @@
<object-type name="QQuickWidget">
- <enum-type name="ResizeMode" />
- <enum-type name="Status" />
+ <enum-type name="ResizeMode"/>
+ <enum-type name="Status"/>
</object-type>
</typesystem>
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 @@
****************************************************************************/
-->
<typesystem package="PySide2.QtScript">
- <load-typesystem name="QtCore/typesystem_core.xml" generate="no" />
+ <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
<object-type name="QScriptable"/>
<object-type name="QScriptClass">
@@ -62,7 +62,7 @@
<enum-type name="QObjectWrapOption" flags="QObjectWrapOptions"/>
<enum-type name="ValueOwnership"/>
<!-- Not supported BUG #957-->
- <modify-function signature="scriptValueFromQMetaObject()" remove="all" />
+ <modify-function signature="scriptValueFromQMetaObject()" remove="all"/>
</object-type>
<object-type name="QScriptExtensionInterface"/>
<object-type name="QScriptExtensionPlugin"/>
@@ -82,53 +82,23 @@
<enum-type name="ResolveFlag" flags="ResolveFlags"/>
<enum-type name="SpecialValue"/>
<add-function signature="__repr__" return-type="PyObject*">
- <inject-code class="target" position="beginning">
- 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);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtscript.cpp" snippet="qscriptvalue-repr"/>
</add-function>
<add-function signature="__mgetitem__">
- <inject-code>
- 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;
- }
- </inject-code>
+ <inject-code file="../glue/qtscript.cpp" snippet="qscriptvalue-mgetitem"/>
</add-function>
<add-function signature="__iter__()" return-type="PyObject*">
- <inject-code file="qscript_value_iterator_glue.cpp" />
+ <inject-code file="qscript_value_iterator_glue.cpp"/>
</add-function>
</value-type>
<object-type name="QScriptValueIterator">
<add-function signature="__iter__()" return-type="PyObject*">
<inject-code>
- <insert-template name="__iter__" />
+ <insert-template name="__iter__"/>
</inject-code>
</add-function>
<add-function signature="__next__()" return-type="PyObject*">
- <inject-code>
- 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);
- }
- </inject-code>
+ <inject-code file="../glue/qtscript.cpp" snippet="qscriptvalueiterator-next"/>
</add-function>
</object-type>
</typesystem>
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 @@
****************************************************************************/
-->
<typesystem package="PySide2.QtScriptTools">
- <load-typesystem name="QtScript/typesystem_script.xml" generate="no" />
- <load-typesystem name="QtGui/typesystem_gui.xml" generate="no" />
- <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no" />
+ <load-typesystem name="QtScript/typesystem_script.xml" generate="no"/>
+ <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
+ <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
<object-type name="QScriptEngineDebugger">
<enum-type name="DebuggerAction"/>
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 @@
<include file-name="QStringList" location="global"/>
<include file-name="QSize" location="global"/>
</extra-includes>
- <modify-function signature="exec(QString)const" rename="exec_" allow-thread="yes" />
- <modify-function signature="open()" allow-thread="yes" />
- <modify-function signature="open(const QString&amp;, const QString&amp;)" allow-thread="yes" />
- <modify-function signature="commit()" allow-thread="yes" />
- <modify-function signature="rollback()" allow-thread="yes" />
- <modify-function signature="transaction()" allow-thread="yes" />
+ <modify-function signature="exec(QString)const" rename="exec_" allow-thread="yes"/>
+ <modify-function signature="open()" allow-thread="yes"/>
+ <modify-function signature="open(const QString&amp;, const QString&amp;)" allow-thread="yes"/>
+ <modify-function signature="commit()" allow-thread="yes"/>
+ <modify-function signature="rollback()" allow-thread="yes"/>
+ <modify-function signature="transaction()" allow-thread="yes"/>
<modify-function signature="registerSqlDriver(const QString&amp;,QSqlDriverCreatorBase*)">
<modify-argument index="2">
<define-ownership owner="c++"/>
@@ -86,15 +86,15 @@
<include file-name="QStringList" location="global"/>
<include file-name="QSize" location="global"/>
</extra-includes>
- <modify-function signature="exec()" rename="exec_" allow-thread="yes" />
- <modify-function signature="exec(const QString&amp;)" rename="exec_" allow-thread="yes" />
- <modify-function signature="prepare(const QString&amp;)" allow-thread="yes" />
- <modify-function signature="clear()" allow-thread="yes" />
- <modify-function signature="last()" allow-thread="yes" />
- <modify-function signature="first()" allow-thread="yes" />
- <modify-function signature="previous()" allow-thread="yes" />
- <modify-function signature="next()" allow-thread="yes" />
- <modify-function signature="seek(int,bool)" allow-thread="yes" />
+ <modify-function signature="exec()" rename="exec_" allow-thread="yes"/>
+ <modify-function signature="exec(const QString&amp;)" rename="exec_" allow-thread="yes"/>
+ <modify-function signature="prepare(const QString&amp;)" allow-thread="yes"/>
+ <modify-function signature="clear()" allow-thread="yes"/>
+ <modify-function signature="last()" allow-thread="yes"/>
+ <modify-function signature="first()" allow-thread="yes"/>
+ <modify-function signature="previous()" allow-thread="yes"/>
+ <modify-function signature="next()" allow-thread="yes"/>
+ <modify-function signature="seek(int,bool)" allow-thread="yes"/>
</value-type>
<value-type name="QSqlRecord">
@@ -107,7 +107,7 @@
<enum-type name="ErrorType"/>
</value-type>
- <value-type name="QSqlIndex" />
+ <value-type name="QSqlIndex"/>
<value-type name="QSqlRelation"/>
@@ -118,10 +118,10 @@
</value-type>
<object-type name="QSqlDriver">
- <enum-type name="DbmsType" />
+ <enum-type name="DbmsType"/>
<enum-type name="DriverFeature"/>
<enum-type name="IdentifierType"/>
- <enum-type name="NotificationSource" />
+ <enum-type name="NotificationSource"/>
<enum-type name="StatementType"/>
<extra-includes>
<include file-name="QSqlQuery" location="global"/>
@@ -131,10 +131,10 @@
<include file-name="QStringList" location="global"/>
<include file-name="QSize" location="global"/>
</extra-includes>
- <modify-function signature="beginTransaction()" allow-thread="yes" />
- <modify-function signature="commitTransaction()" allow-thread="yes" />
- <modify-function signature="rollbackTransaction()" allow-thread="yes" />
- <modify-function signature="open(const QString&amp;,const QString&amp;,const QString&amp;,const QString&amp;,int,const QString&amp;)" allow-thread="yes" />
+ <modify-function signature="beginTransaction()" allow-thread="yes"/>
+ <modify-function signature="commitTransaction()" allow-thread="yes"/>
+ <modify-function signature="rollbackTransaction()" allow-thread="yes"/>
+ <modify-function signature="open(const QString&amp;,const QString&amp;,const QString&amp;,const QString&amp;,int,const QString&amp;)" allow-thread="yes"/>
<!-- ### This is too low level for Python, and pointer would be useless for the Python programmer -->
<modify-function signature="handle()const" remove="all"/>
<!-- ### -->
@@ -150,7 +150,7 @@
</extra-includes>
</object-type>
<object-type name="QSqlRelationalTableModel">
- <enum-type name="JoinMode" />
+ <enum-type name="JoinMode"/>
<extra-includes>
<include file-name="QStringList" location="global"/>
<include file-name="QSize" location="global"/>
@@ -167,15 +167,15 @@
<include file-name="QSize" location="global"/>
</extra-includes>
<!-- ### This isn't part of Qt public API -->
- <modify-function signature="virtual_hook(int,void*)" remove="all" />
+ <modify-function signature="virtual_hook(int,void*)" remove="all"/>
<!-- ### -->
- <modify-function signature="exec()" rename="exec_" allow-thread="yes" />
- <modify-function signature="fetchLast()" allow-thread="yes" />
- <modify-function signature="fetchFirst()" allow-thread="yes" />
- <modify-function signature="fetchNext()" allow-thread="yes" />
- <modify-function signature="fetchPrevious()" allow-thread="yes" />
- <modify-function signature="fetch(int)" allow-thread="yes" />
- <modify-function signature="prepare(QString)" allow-thread="yes" />
+ <modify-function signature="exec()" rename="exec_" allow-thread="yes"/>
+ <modify-function signature="fetchLast()" allow-thread="yes"/>
+ <modify-function signature="fetchFirst()" allow-thread="yes"/>
+ <modify-function signature="fetchNext()" allow-thread="yes"/>
+ <modify-function signature="fetchPrevious()" allow-thread="yes"/>
+ <modify-function signature="fetch(int)" allow-thread="yes"/>
+ <modify-function signature="prepare(QString)" allow-thread="yes"/>
</object-type>
<object-type name="QSqlTableModel">
<enum-type name="EditStrategy"/>
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 @@
<typesystem package="PySide2.QtSvg">
<load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
- <object-type name="QSvgRenderer" />
- <object-type name="QSvgWidget" />
+ <object-type name="QSvgRenderer"/>
+ <object-type name="QSvgWidget"/>
<object-type name="QSvgGenerator">
<modify-function signature="setOutputDevice(QIODevice*)">
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.
<object-type name="QTouchDevice">
- <enum-type name="CapabilityFlag" flags="Capabilities" />
- <enum-type name="DeviceType" />
+ <enum-type name="CapabilityFlag" flags="Capabilities"/>
+ <enum-type name="DeviceType"/>
</object-type>
^^^ 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 @@
****************************************************************************/
-->
<typesystem package="PySide2.QtTextToSpeech">
- <load-typesystem name="QtCore/typesystem_core.xml" generate="no" />
+ <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
<object-type name="QTextToSpeech">
<enum-type name="State"/>
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 @@
-->
<typesystem package="PySide2.QtUiTools">
- <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no" />
- <load-typesystem name="QtXml/typesystem_xml.xml" generate="no" />
+ <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
+ <load-typesystem name="QtXml/typesystem_xml.xml" generate="no"/>
<object-type name="QUiLoader">
<extra-includes>
<include file-name="glue/plugins.h" location="local"/>
</extra-includes>
<inject-code class="native" position="beginning" file="glue/uitools_loadui.cpp"/>
- <inject-code>
- Q_IMPORT_PLUGIN(PyCustomWidgets);
- </inject-code>
+ <inject-code file="../glue/qtuitools.cpp" snippet="quiloader"/>
<add-function signature="registerCustomWidget(PyObject*)" return-type="void">
<modify-argument index="1">
- <rename to="customWidgetType" />
+ <rename to="customWidgetType"/>
</modify-argument>
<inject-documentation format="target" mode="append">
Registers a Python created custom widget to QUiLoader, so it can be recognized when
@@ -87,10 +85,7 @@
# ...
</inject-documentation>
- <inject-code class="target" position="beginning">
- registerCustomWidget(%PYARG_1);
- %CPPSELF.addPluginPath(""); // force reload widgets
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtuitools.cpp" snippet="quiloader-registercustomwidget"/>
</add-function>
<modify-function signature="createAction(QObject*,const QString&amp;)">
<modify-argument index="return">
@@ -119,31 +114,25 @@
<modify-function signature="load(QIODevice*,QWidget*)">
<modify-argument index="2">
- <replace-default-expression with="0" />
- <rename to="parentWidget" />
+ <replace-default-expression with="0"/>
+ <rename to="parentWidget"/>
</modify-argument>
<modify-argument index="return">
<define-ownership class="target" owner="target"/>
</modify-argument>
- <inject-code>
- // Avoid calling the original function: %CPPSELF.%FUNCTION_NAME()
- %PYARG_0 = QUiLoadedLoadUiFromDevice(%CPPSELF, %1, %2);
- </inject-code>
+ <inject-code file="../glue/qtuitools.cpp" snippet="quiloader-load-1"/>
</modify-function>
<!-- Syntax sugar -->
<add-function signature="load(QString,QWidget*)" return-type="QWidget*">
<modify-argument index="2">
- <replace-default-expression with="0" />
- <rename to="parentWidget" />
+ <replace-default-expression with="0"/>
+ <rename to="parentWidget"/>
</modify-argument>
<modify-argument index="return">
<define-ownership class="target" owner="target"/>
</modify-argument>
- <inject-code>
- // Avoid calling the original function: %CPPSELF.%FUNCTION_NAME()
- %PYARG_0 = QUiLoaderLoadUiFromFileName(%CPPSELF, %1, %2);
- </inject-code>
+ <inject-code file="../glue/qtuitools.cpp" snippet="quiloader-load-2"/>
</add-function>
</object-type>
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 @@
<typesystem package="PySide2.QtWebChannel">
<load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
- <object-type name="QWebChannel" />
+ <object-type name="QWebChannel"/>
<object-type name="QWebChannelAbstractTransport">
<extra-includes>
<include file-name="QJsonObject" location="global"/>
@@ -50,6 +50,6 @@
</object-type>
<!-- Not sure if this will be useful, but commented out for now because
the QML module is not yet wrapped.
- <object-type name="QQmlWebChannel" /> -->
+ <object-type name="QQmlWebChannel"/> -->
</typesystem>
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 @@
<object-type name="QWebEngineDownloadItem">
<enum-type name="DownloadInterruptReason"/>
- <enum-type name="DownloadState" />
+ <enum-type name="DownloadState"/>
<enum-type name="SavePageFormat"/>
</object-type>
<!-- TODO: Deal with private constructor
- <value-type name="QWebEngineHistory" /> -->
+ <value-type name="QWebEngineHistory"/> -->
- <object-type name="QWebEngineHistoryItem" />
+ <object-type name="QWebEngineHistoryItem"/>
<object-type name="QWebEnginePage">
- <enum-type name="WebAction" />
+ <enum-type name="WebAction"/>
<enum-type name="FindFlag" flags="FindFlags"/>
- <enum-type name="WebWindowType" />
- <enum-type name="PermissionPolicy" />
- <enum-type name="NavigationType" />
- <enum-type name="Feature" />
- <enum-type name="FileSelectionMode" />
- <enum-type name="JavaScriptConsoleMessageLevel" />
+ <enum-type name="WebWindowType"/>
+ <enum-type name="PermissionPolicy"/>
+ <enum-type name="NavigationType"/>
+ <enum-type name="Feature"/>
+ <enum-type name="FileSelectionMode"/>
+ <enum-type name="JavaScriptConsoleMessageLevel"/>
<enum-type name="RenderProcessTerminationStatus"/>
</object-type>
<object-type name="QWebEngineProfile">
- <enum-type name="HttpCacheType" />
- <enum-type name="PersistentCookiesPolicy" />
+ <enum-type name="HttpCacheType"/>
+ <enum-type name="PersistentCookiesPolicy"/>
</object-type>
<value-type name="QWebEngineScript">
- <enum-type name="InjectionPoint" />
- <enum-type name="ScriptWorldId" />
+ <enum-type name="InjectionPoint"/>
+ <enum-type name="ScriptWorldId"/>
</value-type>
<object-type name="QWebEngineScriptCollection"/>
@@ -94,7 +94,7 @@
<enum-type name="WebAttribute"/>
</object-type>
- <object-type name="QWebEngineView" />
+ <object-type name="QWebEngineView"/>
<value-type name="QWebEngineContextMenuData">
<enum-type name="EditFlag" flags="EditFlags" since="5.11"/>
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 @@
<value-type name="QWebHistoryItem"/>
<value-type name="QWebSecurityOrigin">
- <enum-type name="SubdomainSetting" />
+ <enum-type name="SubdomainSetting"/>
</value-type>
<object-type name="QWebSettings">
<enum-type name="FontFamily"/>
<enum-type name="FontSize"/>
- <enum-type name="ThirdPartyCookiePolicy" />
+ <enum-type name="ThirdPartyCookiePolicy"/>
<enum-type name="WebAttribute"/>
<enum-type name="WebGraphic"/>
</object-type>
@@ -87,13 +87,9 @@
<modify-argument index="return">
<define-ownership class="target" owner="default"/>
</modify-argument>
- <inject-code position="end">
- SbkObject* _pyReturn = reinterpret_cast&lt;SbkObject*&gt;(%PYARG_0);
- if (!Shiboken::Object::hasParentInfo(_pyReturn))
- Shiboken::Object::setParent(%PYSELF, %PYARG_0);
- </inject-code>
+ <inject-code position="end" file="../glue/qtwebkitwidgets.cpp" snippet="qwebview-page"/>
</modify-function>
- <modify-function signature="print(QPrinter*)const" rename="print_" />
+ <modify-function signature="print(QPrinter*)const" rename="print_"/>
</object-type>
<value-type name="QWebElement" since="4.6">
@@ -102,34 +98,25 @@
<value-type name="QWebElementCollection" since="4.6">
<add-function signature="__len__">
- <inject-code>
- return %CPPSELF.count();
- </inject-code>
+ <inject-code file="../glue/qtwebkitwidgets.cpp" snippet="qwebelementcollection-len"/>
</add-function>
<add-function signature="__getitem__">
- <inject-code>
- if (_i &lt; 0 || _i >= %CPPSELF.count()) {
- PyErr_SetString(PyExc_IndexError, "index out of bounds");
- return 0;
- }
- QWebElement element = %CPPSELF.at(_i);
- return %CONVERTTOPYTHON[QWebElement](element);
- </inject-code>
+ <inject-code file="../glue/qtwebkitwidgets.cpp" snippet="qwebelementcollection-getitem"/>
</add-function>
</value-type>
<object-type name="QWebFrame">
<enum-type name="RenderLayer" flags="RenderLayers" since="4.6"/>
- <enum-type name="ValueOwnership" />
+ <enum-type name="ValueOwnership"/>
<modify-function signature="addToJavaScriptWindowObject(QString,QObject*,QWebFrame::ValueOwnership)">
<modify-argument index="2">
<parent index="this" action="add"/>
</modify-argument>
</modify-function>
- <modify-function signature="print(QPrinter*)const" rename="print_" />
+ <modify-function signature="print(QPrinter*)const" rename="print_"/>
<modify-function signature="metaData()const">
<modify-argument index="return">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<inject-code position="end">
<insert-template name="convertFromMultiMap">
@@ -149,18 +136,18 @@
<enum-type name="FindFlag" flags="FindFlags"/>
<enum-type name="LinkDelegationPolicy"/>
<enum-type name="NavigationType"/>
- <enum-type name="PermissionPolicy" since="4.8" revision="4800" />
- <enum-type name="VisibilityState" />
+ <enum-type name="PermissionPolicy" since="4.8" revision="4800"/>
+ <enum-type name="VisibilityState"/>
<enum-type name="WebAction"/>
<enum-type name="WebWindowType"/>
- <value-type name="ChooseMultipleFilesExtensionOption" />
- <value-type name="ChooseMultipleFilesExtensionReturn" />
- <value-type name="ErrorPageExtensionOption" since="4.6" />
- <value-type name="ErrorPageExtensionReturn" since="4.6" />
- <value-type name="ExtensionOption" />
- <value-type name="ExtensionReturn" />
- <value-type name="ViewportAttributes" />
+ <value-type name="ChooseMultipleFilesExtensionOption"/>
+ <value-type name="ChooseMultipleFilesExtensionReturn"/>
+ <value-type name="ErrorPageExtensionOption" since="4.6"/>
+ <value-type name="ErrorPageExtensionReturn" since="4.6"/>
+ <value-type name="ExtensionOption"/>
+ <value-type name="ExtensionReturn"/>
+ <value-type name="ViewportAttributes"/>
<modify-function signature="extension(QWebPage::Extension,const QWebPage::ExtensionOption*,QWebPage::ExtensionReturn*)">
<template name="qwebpage_extension_argument_conversion">
@@ -199,7 +186,7 @@
</modify-function>
<modify-function signature="networkAccessManager()const">
<modify-argument index="return">
- <reference-count action="set" variable-name="setNetworkAccessManager(QNetworkAccessManager*)1" />
+ <reference-count action="set" variable-name="setNetworkAccessManager(QNetworkAccessManager*)1"/>
</modify-argument>
</modify-function>
<modify-function signature="view()const">
@@ -238,24 +225,7 @@
</modify-function>
<add-function signature="qt_metacall()">
- <inject-code class="native">
- static int _signalIndex = -1;
- static QMetaMethod _m;
-
- if (_signalIndex == -1) {
- _signalIndex = QWebPage::staticMetaObject.indexOfSlot("shouldInterruptJavaScript()");
- _m = QWebPage::staticMetaObject.method(_signalIndex);
- }
-
- if (_signalIndex == id) {
- Shiboken::GilState gil;
- PyObject* self = (PyObject*)Shiboken::BindingManager::instance().retrieveWrapper(this);
- if (self) {
- Shiboken::AutoDecRef _pyMethod(PyObject_GetAttrString(self, "shouldInterruptJavaScript"));
- return PySide::SignalManager::callPythonMetaMethod(_m, args, _pyMethod, false);
- }
- }
- </inject-code>
+ <inject-code class="native" file="../glue/qtwebkitwidgets.cpp" snippet="qwebpage-qt-metacall"/>
</add-function>
</object-type>
diff --git a/sources/pyside2/PySide2/QtWebSockets/typesystem_websockets.xml b/sources/pyside2/PySide2/QtWebSockets/typesystem_websockets.xml
index 6b26ccd76..cd81439cb 100644
--- a/sources/pyside2/PySide2/QtWebSockets/typesystem_websockets.xml
+++ b/sources/pyside2/PySide2/QtWebSockets/typesystem_websockets.xml
@@ -43,7 +43,7 @@
<load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
<load-typesystem name="QtNetwork/typesystem_network.xml" generate="no"/>
- <object-type name="QMaskGenerator" />
+ <object-type name="QMaskGenerator"/>
<object-type name="QWebSocket">
<extra-includes>
@@ -51,7 +51,7 @@
</extra-includes>
</object-type>
- <object-type name="QWebSocketCorsAuthenticator" />
+ <object-type name="QWebSocketCorsAuthenticator"/>
<namespace-type name="QWebSocketProtocol">
<enum-type name="Version"/>
@@ -59,20 +59,20 @@
</namespace-type>
<object-type name="QWebSocketServer">
- <enum-type name="SslMode" />
+ <enum-type name="SslMode"/>
<extra-includes>
- <include file-name="QWebSocketCorsAuthenticator" location="global" />
+ <include file-name="QWebSocketCorsAuthenticator" location="global"/>
</extra-includes>
</object-type>
<!-- TODO: Gracefully handle the lack of SSL support -->
- <rejection class="QWebSocket" function-name="ignoreSslErrors" />
- <rejection class="QWebSocket" function-name="setSslConfiguration" />
- <rejection class="QWebSocket" function-name="sslConfiguration" />
- <rejection class="QWebSocket" function-name="ignoreSslErrors" />
- <rejection class="QWebSocket" function-name="sslErrors" />
- <rejection class="QWebSocketServer" function-name="setSslConfiguration" />
- <rejection class="QWebSocketServer" function-name="sslConfiguration" />
- <rejection class="QWebSocketServer" function-name="peerVerifyError" />
- <rejection class="QWebSocketServer" function-name="sslErrors" />
+ <rejection class="QWebSocket" function-name="ignoreSslErrors"/>
+ <rejection class="QWebSocket" function-name="setSslConfiguration"/>
+ <rejection class="QWebSocket" function-name="sslConfiguration"/>
+ <rejection class="QWebSocket" function-name="ignoreSslErrors"/>
+ <rejection class="QWebSocket" function-name="sslErrors"/>
+ <rejection class="QWebSocketServer" function-name="setSslConfiguration"/>
+ <rejection class="QWebSocketServer" function-name="sslConfiguration"/>
+ <rejection class="QWebSocketServer" function-name="peerVerifyError"/>
+ <rejection class="QWebSocketServer" function-name="sslErrors"/>
</typesystem>
diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
index d92540d85..8d732d908 100644
--- a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
+++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
@@ -180,7 +180,7 @@
<object-type name="QStyleOptionToolButton" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolButton::Type &amp;&amp; %1-&gt;version == QStyleOptionToolButton::Version">
<enum-type name="StyleOptionType"/>
<enum-type name="StyleOptionVersion"/>
- <enum-type name="ToolButtonFeature" flags="ToolButtonFeatures" />
+ <enum-type name="ToolButtonFeature" flags="ToolButtonFeatures"/>
</object-type>
<value-type name="QStyleOptionViewItem" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItem::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItem::Version">
<enum-type name="Position"/>
@@ -204,30 +204,21 @@
<value-type name="QTreeWidgetItemIterator" >
<modify-function signature="QTreeWidgetItemIterator(QTreeWidget*,QFlags&lt;QTreeWidgetItemIterator::IteratorFlag&gt;)">
<modify-argument index="this">
- <parent index="1" action="add" />
+ <parent index="1" action="add"/>
</modify-argument>
</modify-function>
<add-function signature="__iter__()" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="__iter__" />
+ <insert-template name="__iter__"/>
</inject-code>
</add-function>
<add-function signature="__next__()" return-type="PyObject*">
- <inject-code class="target" position="beginning">
- if (**%CPPSELF) {
- QTreeWidgetItemIterator *%0 = new QTreeWidgetItemIterator((*%CPPSELF)++);
- %PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItemIterator*](%0);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qtreewidgetitemiterator-next"/>
</add-function>
<add-function signature="value()" return-type="QTreeWidgetItem*">
- <inject-code>
- QTreeWidgetItem *%0 = %CPPSELF.operator*();
- %PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItem*](%0);
- Shiboken::Object::releaseOwnership(%PYARG_0);
- </inject-code>
+ <inject-code file="../glue/qtwidgets.cpp" snippet="qtreewidgetitemiterator-value"/>
</add-function>
<enum-type name="IteratorFlag" flags="IteratorFlags"/>
<!-- ### See bug 778 -->
@@ -267,26 +258,14 @@
<enum-type name="GraphicsItemChange"/>
<enum-type name="GraphicsItemFlag" flags="GraphicsItemFlags"/>
<enum-type name="PanelModality" since="4.6"/>
- <inject-code class="target" position="end">
- PyObject *userTypeConstant = PyInt_FromLong(QGraphicsItem::UserType);
- PyDict_SetItemString(reinterpret_cast&lt;PyTypeObject *&gt;(Sbk_QGraphicsItem_TypeF())->tp_dict, "UserType", userTypeConstant);
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtwidgets.cpp" snippet="qgraphicsitem"/>
<modify-function signature="setParentItem(QGraphicsItem*)">
<modify-argument index="this">
<parent index="1" action="add"/>
</modify-argument>
</modify-function>
- <template name="scene_return_parenting">
- if (%0) {
- QObject *parent = %0->parent();
- Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QObject*](parent));
- Shiboken::Object::setParent(pyParent, %PYARG_0);
- }
- </template>
<modify-function signature="scene()const">
- <inject-code position="end">
- <insert-template name="scene_return_parenting"/>
- </inject-code>
+ <inject-code position="end" file="../glue/qtwidgets.cpp" snippet="qgraphicsitem-scene-return-parenting"/>
<modify-argument index="this">
<parent index="return" action="add"/>
</modify-argument>
@@ -354,13 +333,7 @@
<modify-argument index="return">
<replace-type modified-type="(retval, blockingPanel)"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- QGraphicsItem *item_ = NULL;
- %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;item_);
- %PYARG_0 = PyTuple_New(2);
- PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
- PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QGraphicsItem*](item_));
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qgraphicsitem-isblockedbymodalpanel"/>
</modify-function>
<modify-function signature="itemTransform(const QGraphicsItem*,bool*)const">
<modify-argument index="2">
@@ -371,7 +344,7 @@
<replace-type modified-type="(QTransform, bool ok)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="fix_args,bool*" />
+ <insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
<modify-function signature="isObscuredBy(const QGraphicsItem*)const">
@@ -453,7 +426,7 @@
</modify-function>
<modify-function signature="viewOptions()const">
<modify-argument index="return">
- <replace-default-expression with="QStyleOptionViewItem()" />
+ <replace-default-expression with="QStyleOptionViewItem()"/>
</modify-argument>
</modify-function>
<modify-function signature="model()const">
@@ -537,7 +510,7 @@
<object-type name="QDialogButtonBox">
<enum-type name="ButtonLayout"/>
<enum-type name="ButtonRole"/>
- <enum-type name="StandardButton" flags="StandardButtons" />
+ <enum-type name="StandardButton" flags="StandardButtons"/>
<modify-function signature="addButton(QAbstractButton*,QDialogButtonBox::ButtonRole)">
<modify-argument index="1">
<parent index="this" action="add"/>
@@ -562,7 +535,7 @@
<enum-type name="Option" flags="Options"/>
</object-type>
<object-type name="QWizard">
- <enum-type name="WizardButton" />
+ <enum-type name="WizardButton"/>
<enum-type name="WizardOption" flags="WizardOptions"/>
<enum-type name="WizardPixmap"/>
<enum-type name="WizardStyle"/>
@@ -602,7 +575,7 @@
<remove-argument />
</modify-argument>
<modify-argument index="return">
- <replace-type modified-type="PyTuple" />
+ <replace-type modified-type="PyTuple"/>
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="bool*_fix,arg"/>
@@ -613,15 +586,14 @@
<remove-argument />
</modify-argument>
<modify-argument index="return">
- <replace-type modified-type="PyTuple" />
+ <replace-type modified-type="PyTuple"/>
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="bool*_fix,arg,arg,arg,arg"/>
</inject-code>
</modify-function>
</object-type>
- <object-type name="QGraphicsEllipseItem">
- </object-type>
+ <object-type name="QGraphicsEllipseItem"/>
<object-type name="QGraphicsItemAnimation">
<modify-function signature="setItem(QGraphicsItem*)">
<modify-argument index="1">
@@ -638,24 +610,24 @@
</extra-includes>
</object-type>
<object-type name="QGraphicsItemGroup"/>
- <object-type name="QGraphicsLineItem" />
- <object-type name="QGraphicsPathItem" />
+ <object-type name="QGraphicsLineItem"/>
+ <object-type name="QGraphicsPathItem"/>
<object-type name="QGraphicsPixmapItem">
<enum-type name="ShapeMode"/>
</object-type>
<object-type name="QGraphicsPolygonItem"/>
- <object-type name="QGraphicsRectItem" />
- <object-type name="QGraphicsSimpleTextItem" />
+ <object-type name="QGraphicsRectItem"/>
+ <object-type name="QGraphicsSimpleTextItem"/>
<object-type name="QHBoxLayout"/>
<object-type name="QHeaderView">
- <enum-type name="ResizeMode" />
+ <enum-type name="ResizeMode"/>
<modify-function signature="paintSection(QPainter*,QRect,int)const">
<modify-argument index="1" invalidate-after-use="yes"/>
</modify-function>
</object-type>
<object-type name="QItemDelegate">
<!-- ### "doLayout(...)" is an internal method. -->
- <modify-function signature="doLayout(QStyleOptionViewItem,QRect*,QRect*,QRect*,bool)const" remove="all" />
+ <modify-function signature="doLayout(QStyleOptionViewItem,QRect*,QRect*,QRect*,bool)const" remove="all"/>
<!-- ### "selected(QPixmap,QPalette,bool)" is an internal method. -->
<modify-function signature="selected(QPixmap,QPalette,bool)const" remove="all"/>
<!-- ### -->
@@ -687,24 +659,13 @@
<modify-argument index="2">
<reference-count action="set"/>
</modify-argument>
- <inject-code>
- Shiboken::Object::releaseOwnership(%PYARG_2);
- </inject-code>
+ <inject-code file="../glue/qtwidgets.cpp" snippet="qitemeditorfactory-registerEditor"/>
</modify-function>
<modify-function signature="setDefaultFactory(QItemEditorFactory*)">
<modify-argument index="1">
<define-ownership owner="c++"/>
</modify-argument>
- <inject-code>
- //this function is static we need keep ref to default value, to be able to call python virtual functions
- static PyObject* _defaultValue = 0;
- %CPPSELF.%FUNCTION_NAME(%1);
- Py_INCREF(%PYARG_1);
- if (_defaultValue)
- Py_DECREF(_defaultValue);
-
- _defaultValue = %PYARG_1;
- </inject-code>
+ <inject-code file="../glue/qtwidgets.cpp" snippet="qitemeditorfactory-setdefaultfactory"/>
</modify-function>
</object-type>
<object-type name="QListView">
@@ -726,10 +687,10 @@
<modify-function signature="setCentralWidget(QWidget*)">
<inject-code class="target" position="beginning">
<insert-template name="replace_child">
- <replace from="$FUNCTION_GET_OLD" to="centralWidget" />
- <replace from="$CHILD_TYPE" to="QWidget" />
- <replace from="$PYARG" to="%PYARG_1" />
- <replace from="$CPPARG" to="%1" />
+ <replace from="$FUNCTION_GET_OLD" to="centralWidget"/>
+ <replace from="$CHILD_TYPE" to="QWidget"/>
+ <replace from="$PYARG" to="%PYARG_1"/>
+ <replace from="$CPPARG" to="%1"/>
</insert-template>
</inject-code>
</modify-function>
@@ -737,10 +698,10 @@
<modify-function signature="setMenuBar(QMenuBar*)">
<inject-code class="target" position="beginning">
<insert-template name="replace_child">
- <replace from="$FUNCTION_GET_OLD" to="menuBar" />
- <replace from="$CHILD_TYPE" to="QMenuBar" />
- <replace from="$PYARG" to="%PYARG_1" />
- <replace from="$CPPARG" to="%1" />
+ <replace from="$FUNCTION_GET_OLD" to="menuBar"/>
+ <replace from="$CHILD_TYPE" to="QMenuBar"/>
+ <replace from="$PYARG" to="%PYARG_1"/>
+ <replace from="$CPPARG" to="%1"/>
</insert-template>
</inject-code>
</modify-function>
@@ -748,10 +709,10 @@
<modify-function signature="setMenuWidget(QWidget*)">
<inject-code class="target" position="beginning">
<insert-template name="replace_child">
- <replace from="$FUNCTION_GET_OLD" to="menuWidget" />
- <replace from="$CHILD_TYPE" to="QWidget" />
- <replace from="$PYARG" to="%PYARG_1" />
- <replace from="$CPPARG" to="%1" />
+ <replace from="$FUNCTION_GET_OLD" to="menuWidget"/>
+ <replace from="$CHILD_TYPE" to="QWidget"/>
+ <replace from="$PYARG" to="%PYARG_1"/>
+ <replace from="$CPPARG" to="%1"/>
</insert-template>
</inject-code>
</modify-function>
@@ -759,10 +720,10 @@
<modify-function signature="setStatusBar(QStatusBar*)">
<inject-code class="target" position="beginning">
<insert-template name="replace_child">
- <replace from="$FUNCTION_GET_OLD" to="statusBar" />
- <replace from="$CHILD_TYPE" to="QStatusBar" />
- <replace from="$PYARG" to="%PYARG_1" />
- <replace from="$CPPARG" to="%1" />
+ <replace from="$FUNCTION_GET_OLD" to="statusBar"/>
+ <replace from="$CHILD_TYPE" to="QStatusBar"/>
+ <replace from="$PYARG" to="%PYARG_1"/>
+ <replace from="$CPPARG" to="%1"/>
</insert-template>
</inject-code>
</modify-function>
@@ -840,9 +801,9 @@
<object-type name="QMenu">
<inject-code class="native" position="beginning" file="glue/qmenu_glue.cpp"/>
- <modify-function signature="exec()" rename="exec_" allow-thread="yes" />
- <modify-function signature="exec(const QPoint&amp;,QAction*)" rename="exec_" allow-thread="yes" />
- <modify-function signature="exec(QList&lt;QAction*>,const QPoint&amp;,QAction*,QWidget*)" rename="exec_" allow-thread="yes" />
+ <modify-function signature="exec()" rename="exec_" allow-thread="yes"/>
+ <modify-function signature="exec(const QPoint&amp;,QAction*)" rename="exec_" allow-thread="yes"/>
+ <modify-function signature="exec(QList&lt;QAction*>,const QPoint&amp;,QAction*,QWidget*)" rename="exec_" allow-thread="yes"/>
<modify-function signature="addAction(const QString&amp;)">
<modify-argument index="return">
<parent index="this" action="add"/>
@@ -885,53 +846,36 @@
</modify-argument>
</modify-function>
<!-- ### "setNoReplayFor(QWidget*)" is an internal method. -->
- <modify-function signature="setNoReplayFor(QWidget*)" remove="all" />
+ <modify-function signature="setNoReplayFor(QWidget*)" remove="all"/>
<add-function signature="addAction(QString&amp;,PyObject*,QKeySequence&amp;)">
<modify-argument index="3">
- <replace-default-expression with="0" />
+ <replace-default-expression with="0"/>
</modify-argument>
<modify-argument index="return">
<parent index="this" action="add"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- %PYARG_0 = addActionWithPyObject(%CPPSELF, QIcon(), %1, %2, %3);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qmenu-addaction-1"/>
</add-function>
<add-function signature="addAction(QIcon&amp;,QString&amp;,PyObject*,QKeySequence&amp;)">
<modify-argument index="4">
- <replace-default-expression with="0" />
+ <replace-default-expression with="0"/>
</modify-argument>
<modify-argument index="return">
<parent index="this" action="add"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- %PYARG_0 = addActionWithPyObject(%CPPSELF, %1, %2, %3, %4);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qmenu-addaction-2"/>
</add-function>
<add-function signature="addAction(QAction*)">
- <inject-code class="target" position="beginning">
- %CPPSELF.addAction(%1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qmenu-addaction-3"/>
</add-function>
<modify-function signature="clear()">
- <inject-code>
- Shiboken::BindingManager&amp; bm = Shiboken::BindingManager::instance();
- PyObject* pyObj;
- foreach(QAction* act, %CPPSELF.actions()) {
- if ((pyObj = (PyObject*)bm.retrieveWrapper(act)) != 0) {
- Py_INCREF(pyObj);
- Shiboken::Object::setParent(NULL, pyObj);
- Shiboken::Object::invalidate(pyObj);
- Py_DECREF(pyObj);
- }
- }
- </inject-code>
+ <inject-code file="../glue/qtwidgets.cpp" snippet="qmenu-clear"/>
</modify-function>
</object-type>
@@ -949,9 +893,7 @@
</modify-argument>
</modify-function>
<add-function signature="addAction(const QString&amp;,PyObject*)">
- <inject-code class="target" position="beginning">
- %PYARG_0 = addActionWithPyObject(%CPPSELF, %1, %2);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qmenubar-addaction-1"/>
<modify-argument index="return">
<parent index="this" action="add"/>
</modify-argument>
@@ -983,19 +925,11 @@
</modify-argument>
</modify-function>
<modify-function signature="clear()">
- <inject-code>
- foreach(QAction *act, %CPPSELF.actions()) {
- Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));
- Shiboken::Object::setParent(NULL, pyAct);
- Shiboken::Object::invalidate(pyAct);
- }
- </inject-code>
+ <inject-code file="../glue/qtwidgets.cpp" snippet="qmenubar-clear"/>
</modify-function>
<add-function signature="addAction(QAction*)">
- <inject-code class="target" position="beginning">
- %CPPSELF.addAction(%1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qmenubar-addaction-2"/>
</add-function>
</object-type>
@@ -1009,7 +943,7 @@
</modify-argument>
</modify-function>
</object-type>
- <object-type name="QPushButton" />
+ <object-type name="QPushButton"/>
<object-type name="QScrollArea">
<modify-function signature="setWidget(QWidget*)">
<modify-argument index="1">
@@ -1023,18 +957,8 @@
<modify-argument index="4">
<replace-default-expression with="Qt::WindowShortcut"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- %0 = new %TYPE(%1, %2);
- </inject-code>
- <inject-code class="target" position="end">
- Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF,
- const_cast&lt;char *&gt;("connect"),
- const_cast&lt;char *&gt;("OsO"),
- %PYSELF, SIGNAL(activated()), %PYARG_3)
- );
- if (!result.isNull())
- Shiboken::Object::setParent(%PYARG_2, %PYSELF);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qshortcut-1"/>
+ <inject-code class="target" position="end" file="../glue/qtwidgets.cpp" snippet="qshortcut-2"/>
</add-function>
</object-type>
<object-type name="QSpacerItem"/>
@@ -1080,7 +1004,7 @@
<enum-type name="StyleOptionType"/>
<enum-type name="StyleOptionVersion"/>
</object-type>
- <object-type name="QStylePainter" />
+ <object-type name="QStylePainter"/>
<object-type name="QTableView">
<modify-function signature="setHorizontalHeader(QHeaderView*)">
<modify-argument index="1">
@@ -1116,13 +1040,7 @@
</modify-argument>
</modify-function>
<modify-function signature="removeItem(int)">
- <inject-code class="target" position="beginning">
- QWidget *_widget = %CPPSELF.widget(%1);
- if (_widget) {
- Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](_widget));
- Shiboken::Object::setParent(0, pyWidget);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qtoolbox-removeitem"/>
</modify-function>
</object-type>
<object-type name="QToolButton">
@@ -1211,16 +1129,16 @@
<object-type name="QWidgetAction">
<modify-function signature="setDefaultWidget(QWidget*)">
<modify-argument index="1">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="releaseWidget(QWidget*)">
<modify-argument index="1">
- <parent index="this" action="remove" />
+ <parent index="this" action="remove"/>
</modify-argument>
</modify-function>
</object-type>
- <object-type name="QWidgetItem" polymorphic-id-expression="%1-&gt;widget()" />
+ <object-type name="QWidgetItem" polymorphic-id-expression="%1-&gt;widget()"/>
<object-type name="QGraphicsSceneContextMenuEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneContextMenu">
<enum-type name="Reason"/>
@@ -1236,10 +1154,10 @@
<!-- ### "setWidget(QWidget*)" is an internal method. -->
<modify-function signature="setWidget(QWidget*)" remove="all"/>
</object-type>
- <object-type name="QGraphicsSceneMoveEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMove" />
- <object-type name="QGraphicsSceneResizeEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneResize" />
- <object-type name="QGraphicsSceneHelpEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHelp" />
- <object-type name="QGraphicsSceneHoverEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHoverEnter || %1-&gt;type() == QEvent::GraphicsSceneHoverLeave || %1-&gt;type() == QEvent::GraphicsSceneHoverMove" />
+ <object-type name="QGraphicsSceneMoveEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMove"/>
+ <object-type name="QGraphicsSceneResizeEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneResize"/>
+ <object-type name="QGraphicsSceneHelpEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHelp"/>
+ <object-type name="QGraphicsSceneHoverEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHoverEnter || %1-&gt;type() == QEvent::GraphicsSceneHoverLeave || %1-&gt;type() == QEvent::GraphicsSceneHoverMove"/>
<object-type name="QGraphicsSceneMouseEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMouseDoubleClick || %1-&gt;type() == QEvent::GraphicsSceneMouseMove || %1-&gt;type() == QEvent::GraphicsSceneMousePress || %1-&gt;type() == QEvent::GraphicsSceneMouseRelease"/>
<object-type name="QGraphicsSceneWheelEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneWheel"/>
@@ -1287,27 +1205,27 @@
<modify-argument index="3" invalidate-after-use="yes"/>
<modify-argument index="4">
<replace-default-expression with="0"/>
- <rename to="widget" />
+ <rename to="widget"/>
</modify-argument>
</modify-function>
<modify-function signature="drawControl(QStyle::ControlElement,const QStyleOption*,QPainter*,const QWidget*)const">
<modify-argument index="3" invalidate-after-use="yes"/>
<modify-argument index="4">
<replace-default-expression with="0"/>
- <rename to="widget" />
+ <rename to="widget"/>
</modify-argument>
</modify-function>
<modify-function signature="drawPrimitive(QStyle::PrimitiveElement,const QStyleOption*,QPainter*,const QWidget*)const">
<modify-argument index="3" invalidate-after-use="yes"/>
<modify-argument index="4">
<replace-default-expression with="0"/>
- <rename to="widget" />
+ <rename to="widget"/>
</modify-argument>
</modify-function>
<modify-function signature="hitTestComplexControl(QStyle::ComplexControl,const QStyleOptionComplex*,const QPoint&amp;,const QWidget*)const">
<modify-argument index="4">
<replace-default-expression with="0"/>
- <rename to="widget" />
+ <rename to="widget"/>
</modify-argument>
</modify-function>
<modify-function signature="styleHint(QStyle::StyleHint,const QStyleOption*,const QWidget*,QStyleHintReturn*)const">
@@ -1322,9 +1240,9 @@
</object-type>
<object-type name="QColorDialog">
<enum-type name="ColorDialogOption" flags="ColorDialogOptions"/>
- <modify-function signature="getColor(const QColor&amp;,QWidget*,const QString&amp;,QFlags&lt;QColorDialog::ColorDialogOption>)" allow-thread="yes" />
+ <modify-function signature="getColor(const QColor&amp;,QWidget*,const QString&amp;,QFlags&lt;QColorDialog::ColorDialogOption>)" allow-thread="yes"/>
<!-- Qt5: obsolete -->
- <modify-function signature="getRgba(unsigned int,bool*,QWidget*)" remove="all" />
+ <modify-function signature="getRgba(unsigned int,bool*,QWidget*)" remove="all"/>
</object-type>
<object-type name="QLayout">
@@ -1336,20 +1254,14 @@
<modify-argument index="return">
<define-ownership owner="default"/>
</modify-argument>
- <inject-code class="target" position="end">
- addLayoutOwnership(%CPPSELF, %0);
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtwidgets.cpp" snippet="addownership-0"/>
</modify-function>
<modify-function signature="removeWidget(QWidget*)">
- <inject-code class="target" position="beginning">
- removeLayoutOwnership(%CPPSELF, %1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="removeownership-1"/>
</modify-function>
<modify-function signature="removeItem(QLayoutItem*)">
- <inject-code class="target" position="beginning">
- removeLayoutOwnership(%CPPSELF, %1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="removeownership-1"/>
</modify-function>
<modify-function signature="parentWidget()const">
@@ -1368,35 +1280,25 @@
</modify-function>
<modify-function signature="addItem(QLayoutItem*)">
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-1"/>
</modify-function>
<modify-function signature="addWidget(QWidget*)">
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-1"/>
</modify-function>
<modify-function signature="addChildWidget(QWidget*)">
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-1"/>
</modify-function>
<modify-function signature="addChildLayout(QLayout*)">
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-1"/>
</modify-function>
<modify-function signature="setMenuBar(QWidget*)">
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-1"/>
</modify-function>
<modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1412,20 +1314,18 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
<inject-code class="native" position="end">
<insert-template name="fix_native_return_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
<add-function signature="setAlignment(QFlags&lt;Qt::AlignmentFlag&gt;)">
- <inject-code class="target" position="beginning">
- %CPPSELF.setAlignment(%1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qlayout-setalignment"/>
</add-function>
</object-type>
@@ -1434,53 +1334,37 @@
<inject-code class="native" position="beginning" file="glue/qlayout_help_functions.cpp"/>
<enum-type name="StackingMode"/>
<modify-function signature="insertWidget(int,QWidget*)">
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %2);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-2"/>
</modify-function>
</object-type>
<object-type name="QBoxLayout">
<inject-code class="native" position="beginning" file="glue/qlayout_help_functions.cpp"/>
- <enum-type name="Direction" />
+ <enum-type name="Direction"/>
<modify-function signature="addWidget(QWidget*,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-1"/>
</modify-function>
<modify-function signature="addLayout(QLayout*,int)">
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-1"/>
</modify-function>
<modify-function signature="insertWidget(int,QWidget*,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %2);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-2"/>
</modify-function>
<modify-function signature="insertLayout(int,QLayout*,int)">
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %2);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-2"/>
</modify-function>
<modify-function signature="insertItem(int,QLayoutItem*)">
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %2);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-2"/>
</modify-function>
<modify-function signature="addSpacerItem(QSpacerItem*)">
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-1"/>
</modify-function>
<modify-function signature="insertSpacerItem(int,QSpacerItem*)">
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %2);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-2"/>
</modify-function>
</object-type>
@@ -1490,41 +1374,31 @@
<modify-argument index="return">
<define-ownership owner="default"/>
</modify-argument>
- <inject-code class="target" position="end">
- addLayoutOwnership(%CPPSELF, %0);
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtwidgets.cpp" snippet="addownership-0"/>
</modify-function>
<modify-function signature="addWidget(QWidget*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
<modify-argument index="4">
<rename to="alignment"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-1"/>
</modify-function>
<modify-function signature="addWidget(QWidget*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
<modify-argument index="6">
<rename to="alignment"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-1"/>
</modify-function>
<modify-function signature="addLayout(QLayout*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
<modify-argument index="4">
<rename to="alignment"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-1"/>
</modify-function>
<modify-function signature="addLayout(QLayout*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
<modify-argument index="6">
<rename to="alignment"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-1"/>
</modify-function>
<modify-function signature="addItem(QLayoutItem*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
<modify-argument index="4">
@@ -1536,13 +1410,11 @@
<modify-argument index="6">
<rename to="alignment"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- addLayoutOwnership(%CPPSELF, %1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="addownership-1"/>
</modify-function>
<modify-function signature="getItemPosition(int,int*,int*,int*,int*)const">
<modify-argument index="return">
- <replace-type modified-type="PyObject*" />
+ <replace-type modified-type="PyObject*"/>
</modify-argument>
<modify-argument index="2">
<remove-argument/>
@@ -1557,15 +1429,7 @@
<remove-argument/>
<remove-default-expression/>
</modify-argument>
- <inject-code class="target" position="beginning">
- int a, b, c, d;
- %CPPSELF.%FUNCTION_NAME(%1, &amp;a, &amp;b, &amp;c, &amp;d);
- %PYARG_0 = PyTuple_New(4);
- PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](a));
- PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](b));
- PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](c));
- PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[int](d));
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qgridlayout-getitemposition"/>
</modify-function>
</object-type>
@@ -1586,7 +1450,7 @@
</modify-function>
<modify-function signature="scene()const">
<inject-code position="end">
- <insert-template name="scene_return_parenting"/>
+ <insert-template name="scene-return-parenting"/>
</inject-code>
<modify-argument index="return">
<define-ownership owner="default"/>
@@ -1722,11 +1586,11 @@
<enum-type name="SceneLayer" flags="SceneLayers"/>
<!-- Qt5: note: this was called 'obsolete'. Is that true? -->
- <modify-function signature="drawItems(QPainter*,int,QGraphicsItem*[],const QStyleOptionGraphicsItem[],QWidget*)" remove="all" />
+ <modify-function signature="drawItems(QPainter*,int,QGraphicsItem*[],const QStyleOptionGraphicsItem[],QWidget*)" remove="all"/>
<modify-function signature="createItemGroup(const QList&lt;QGraphicsItem*&gt;&amp;)">
<modify-argument index="1">
- <parent index="return" action="add" />
+ <parent index="return" action="add"/>
</modify-argument>
<modify-argument index="return">
<define-ownership owner="default"/>
@@ -1734,17 +1598,7 @@
</modify-function>
<modify-function signature="destroyItemGroup(QGraphicsItemGroup*)">
- <inject-code>
- QGraphicsItem* parentItem = %1->parentItem();
- Shiboken::AutoDecRef parent(%CONVERTTOPYTHON[QGraphicsItem*](parentItem));
- foreach (QGraphicsItem* item, %1->childItems())
- Shiboken::Object::setParent(parent, %CONVERTTOPYTHON[QGraphicsItem*](item));
- %BEGIN_ALLOW_THREADS
- %CPPSELF.%FUNCTION_NAME(%1);
- %END_ALLOW_THREADS
- // the arg was destroyed by Qt.
- Shiboken::Object::invalidate(%PYARG_1);
- </inject-code>
+ <inject-code file="../glue/qtwidgets.cpp" snippet="qgraphicsscene-destroyitemgroup"/>
</modify-function>
<modify-function signature="contextMenuEvent(QGraphicsSceneContextMenuEvent*)">
@@ -1803,97 +1657,81 @@
</modify-function>
<modify-function signature="addItem(QGraphicsItem*)">
<modify-argument index="1">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="addEllipse(const QRectF&amp;,const QPen&amp;,const QBrush&amp;)">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="addEllipse(qreal,qreal,qreal,qreal,const QPen&amp;,const QBrush&amp;)">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="addLine(const QLineF&amp;,const QPen&amp;)">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="addLine(qreal,qreal,qreal,qreal,const QPen&amp;)">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="addPath(const QPainterPath&amp;,const QPen&amp;,const QBrush&amp;)">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="addPixmap(const QPixmap&amp;)">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="addPolygon(const QPolygonF&amp;,const QPen&amp;,const QBrush&amp;)">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="addRect(const QRectF&amp;,const QPen&amp;,const QBrush&amp;)">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="addRect(qreal,qreal,qreal,qreal,const QPen&amp;,const QBrush&amp;)">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="addText(const QString&amp;,const QFont&amp;)">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="addSimpleText(const QString&amp;,const QFont&amp;)">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="addWidget(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
<!-- TODO: Add a keeper attribute to reference-count tag to do what this inject code do. -->
- <inject-code>
- %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2);
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
- Shiboken::Object::keepReference((SbkObject*)%PYARG_0, "setWidget(QWidget*)1", %PYARG_1);
- </inject-code>
+ <inject-code file="../glue/qtwidgets.cpp" snippet="qgraphicsscene-addwidget"/>
</modify-function>
<modify-function signature="clear()">
- <inject-code>
- const QList&lt;QGraphicsItem*> items = %CPPSELF.items();
- Shiboken::BindingManager&amp; bm = Shiboken::BindingManager::instance();
- foreach (QGraphicsItem* item, items) {
- SbkObject* obj = bm.retrieveWrapper(item);
- if (obj) {
- if (reinterpret_cast&lt;PyObject*&gt;(obj)->ob_refcnt > 1) // If the refcnt is 1 the object will vannish anyway.
- Shiboken::Object::invalidate(obj);
- Shiboken::Object::removeParent(obj);
- }
- }
- %CPPSELF.%FUNCTION_NAME();
- </inject-code>
+ <inject-code file="../glue/qtwidgets.cpp" snippet="qgraphicsscene-clear"/>
</modify-function>
<modify-function signature="removeItem(QGraphicsItem*)">
<modify-argument index="1">
- <parent index="this" action="remove" />
+ <parent index="this" action="remove"/>
</modify-argument>
</modify-function>
@@ -1961,16 +1799,7 @@
</modify-argument>
</modify-function>
<modify-function signature="clear()">
- <inject-code>
- QTreeWidgetItem *rootItem = %CPPSELF.invisibleRootItem();
- Shiboken::BindingManager &amp;bm = Shiboken::BindingManager::instance();
- for (int i = 0; i &lt; rootItem->childCount(); ++i) {
- QTreeWidgetItem *item = rootItem->child(i);
- SbkObject* wrapper = bm.retrieveWrapper(item);
- if (wrapper)
- Shiboken::Object::setParent(0, reinterpret_cast&lt;PyObject*&gt;(wrapper));
- }
- </inject-code>
+ <inject-code file="../glue/qtwidgets.cpp" snippet="qtreewidget-clear"/>
</modify-function>
</object-type>
<object-type name="QAbstractItemDelegate">
@@ -2136,23 +1965,13 @@
<modify-argument index="return">
<define-ownership class="target" owner="default"/>
</modify-argument>
- <inject-code class="target" position="end">
- // Only call the parent function if this return some value
- // the parent can be the TreeWidget
- if (%0)
- Shiboken::Object::setParent(%PYARG_0, %PYSELF);
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtwidgets.cpp" snippet="qtreewidgetitem"/>
</modify-function>
<modify-function signature="treeWidget()const">
<modify-argument index="return">
<define-ownership class="target" owner="default"/>
</modify-argument>
- <inject-code class="target" position="end">
- // Only call the parent function if this return some value
- // the parent can be the TreeWidgetItem
- if (%0)
- Shiboken::Object::setParent(%PYARG_0, %PYSELF);
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtwidgets.cpp" snippet="qtreewidgetitem"/>
</modify-function>
</object-type>
@@ -2179,20 +1998,7 @@
</modify-argument>
</modify-function>
<modify-function signature="clear()">
- <inject-code class="target" position="beginning">
- Shiboken::BindingManager &amp;bm = Shiboken::BindingManager::instance();
- PyObject *pyObj;
- for (int i = 0; i &lt; %CPPSELF.count(); i++) {
- QListWidgetItem *item = %CPPSELF.item(i);
- if ((pyObj = reinterpret_cast&lt;PyObject*&gt;(bm.retrieveWrapper(item))) != 0) {
- Py_INCREF(pyObj);
- Shiboken::Object::setParent(NULL, pyObj);
- Shiboken::Object::invalidate(pyObj);
- Py_DECREF(pyObj);
- }
- }
- %CPPSELF.%FUNCTION_NAME();
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qlistwidget-clear"/>
</modify-function>
</object-type>
@@ -2221,7 +2027,7 @@
<include file-name="QMessageBox" location="global"/>
</extra-includes>
- <inject-code class="native" file="glue/qwidget_glue.cpp" position="beginning" />
+ <inject-code class="native" file="glue/qwidget_glue.cpp" position="beginning"/>
<enum-type name="RenderFlag" flags="RenderFlags"/>
@@ -2378,25 +2184,10 @@
</modify-function>
<modify-function signature="setStyle(QStyle*)">
- <inject-code class="target" position="end">
- Shiboken::Object::keepReference(reinterpret_cast&lt;SbkObject*&gt;(%PYSELF), "__style__", %PYARG_1);
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtwidgets.cpp" snippet="qwidget-setstyle"/>
</modify-function>
<modify-function signature="style()const">
- <inject-code class="target" position="end">
- QStyle* myStyle = %CPPSELF->style();
- if (myStyle &amp;&amp; qApp) {
- %PYARG_0 = %CONVERTTOPYTHON[QStyle*](myStyle);
- QStyle *appStyle = qApp->style();
- if (appStyle == myStyle) {
- Shiboken::AutoDecRef pyApp(%CONVERTTOPYTHON[QApplication*](qApp));
- Shiboken::Object::setParent(pyApp, %PYARG_0);
- Shiboken::Object::releaseOwnership(%PYARG_0);
- } else {
- Shiboken::Object::keepReference(reinterpret_cast&lt;SbkObject*&gt;(%PYSELF), "__style__", %PYARG_0);
- }
- }
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtwidgets.cpp" snippet="qwidget-style"/>
<modify-argument index="return">
<define-ownership owner="default"/>
</modify-argument>
@@ -2416,7 +2207,7 @@
<modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -2432,12 +2223,12 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
<inject-code class="native" position="end">
<insert-template name="fix_native_return_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
@@ -2448,12 +2239,9 @@
</modify-function>
<modify-function signature="setLayout(QLayout*)">
- <inject-code class="target" position="beginning">
- qwidgetSetLayout(%CPPSELF, %1);
- // %FUNCTION_NAME() - disable generation of function call.
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qwidget-setlayout"/>
</modify-function>
- <modify-function signature="raise()" rename="raise_" />
+ <modify-function signature="raise()" rename="raise_"/>
<modify-function signature="setParent(QWidget*,QFlags&lt;Qt::WindowType>)">
<modify-argument index="this">
<parent index="1" action="add"/>
@@ -2470,7 +2258,7 @@
<object-type name="QMessageBox">
<enum-type name="ButtonRole"/>
<enum-type name="Icon"/>
- <enum-type name="StandardButton" flags="StandardButtons" />
+ <enum-type name="StandardButton" flags="StandardButtons"/>
<modify-function signature="removeButton(QAbstractButton*)">
<modify-argument index="1">
<parent index="this" action="add"/>
@@ -2562,26 +2350,10 @@
<!-- This function need be re-implemented in inject code -->
<modify-function signature="removeTab(int)">
- <inject-code class="target" position="beginning">
- QWidget* tab = %CPPSELF.widget(%1);
- if (tab) {
- Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](tab));
- %CPPSELF.%FUNCTION_NAME(%1);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qtabwidget-removetab"/>
</modify-function>
<modify-function signature="clear()">
- <inject-code class="target" position="beginning">
- Shiboken::BindingManager&amp; bm = Shiboken::BindingManager::instance();
- for (int i = 0; i &lt; %CPPSELF.count(); i++) {
- QWidget* widget = %CPPSELF.widget(i);
- if (bm.hasWrapper(widget)) {
- Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](widget));
- Shiboken::Object::releaseOwnership(pyWidget);
- }
- }
- %CPPSELF.%FUNCTION_NAME();
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qtabwidget-clear"/>
</modify-function>
</object-type>
<object-type name="QDateTimeEdit">
@@ -2593,7 +2365,7 @@
</modify-function>
</object-type>
<object-type name="QSlider">
- <enum-type name="TickPosition" />
+ <enum-type name="TickPosition"/>
</object-type>
<object-type name="QProgressDialog">
<modify-function signature="setBar(QProgressBar*)">
@@ -2654,8 +2426,8 @@
</modify-argument>
</modify-function>
- <modify-function signature="getExistingDirectory(QWidget*,const QString&amp;,const QString&amp;,QFlags&lt;QFileDialog::Option>)" allow-thread="yes" />
- <modify-function signature="getExistingDirectoryUrl(QWidget*,const QString&amp;,const QUrl&amp;,QFlags&lt;QFileDialog::Option>,const QStringList&amp;)" />
+ <modify-function signature="getExistingDirectory(QWidget*,const QString&amp;,const QString&amp;,QFlags&lt;QFileDialog::Option>)" allow-thread="yes"/>
+ <modify-function signature="getExistingDirectoryUrl(QWidget*,const QString&amp;,const QUrl&amp;,QFlags&lt;QFileDialog::Option>,const QStringList&amp;)"/>
<modify-function signature="getOpenFileName(QWidget*,const QString&amp;,const QString&amp;,const QString&amp;,QString*,QFlags&lt;QFileDialog::Option&gt;)" allow-thread="yes">
<modify-argument index="return">
<replace-type modified-type="(fileName, selectedFilter)"/>
@@ -2744,8 +2516,8 @@
<enum-type name="SelectionBehavior"/>
<enum-type name="ButtonPosition"/>
</object-type>
- <object-type name="QRadioButton" />
- <object-type name="QScrollBar" />
+ <object-type name="QRadioButton"/>
+ <object-type name="QScrollBar"/>
<object-type name="QAbstractScrollArea">
<enum-type name="SizeAdjustPolicy"/>
<modify-function signature="setViewport(QWidget*)">
@@ -2853,7 +2625,7 @@
<object-type name="QSplitter">
<modify-function signature="getRange(int,int*,int*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="2">
<remove-argument/>
@@ -2863,7 +2635,7 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_args,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
@@ -2878,7 +2650,7 @@
</modify-argument>
</modify-function>
</object-type>
- <object-type name="QGroupBox" />
+ <object-type name="QGroupBox"/>
<object-type name="QStackedWidget">
<modify-function signature="addWidget(QWidget*)">
<modify-argument index="1">
@@ -2902,7 +2674,7 @@
</modify-function>
</object-type>
<object-type name="QSplitterHandle"/>
- <object-type name="QDial" />
+ <object-type name="QDial"/>
<object-type name="QKeySequenceEdit"/>
<object-type name="QLineEdit">
<enum-type name="ActionPosition"/>
@@ -2917,10 +2689,10 @@
<parent index="this" action="add"/>
</modify-argument>
</modify-function>
- <modify-function signature="del()" rename="del_" />
+ <modify-function signature="del()" rename="del_"/>
<modify-function signature="getTextMargins(int*,int*,int*,int*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -2936,15 +2708,13 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
<add-function signature="addAction(QAction*)">
- <inject-code class="target" position="beginning">
- %CPPSELF.addAction(%1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qlineedit-addaction"/>
</add-function>
</object-type>
@@ -3035,7 +2805,7 @@
<object-type name="QToolBar">
<modify-function signature="addAction(QIcon,QString,const QObject*,const char*)">
<modify-argument index="3">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="4">
<remove-argument />
@@ -3043,20 +2813,11 @@
<modify-argument index="return">
<parent index="this" action="add"/>
</modify-argument>
-
- <inject-code>
- QAction *action = %CPPSELF.addAction(%1, %2);
- %PYARG_0 = %CONVERTTOPYTHON[QAction*](action);
- Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0,
- const_cast&lt;char *&gt;("connect"),
- const_cast&lt;char *&gt;("OsO"),
- %PYARG_0, SIGNAL(triggered()), %PYARG_3)
- );
- </inject-code>
+ <inject-code file="../glue/qtwidgets.cpp" snippet="qtoolbar-addaction-1"/>
</modify-function>
<modify-function signature="addAction(QString,const QObject*,const char*)">
<modify-argument index="2">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="3">
<remove-argument />
@@ -3064,15 +2825,7 @@
<modify-argument index="return">
<parent index="this" action="add"/>
</modify-argument>
- <inject-code>
- QAction *action = %CPPSELF.addAction(%1);
- %PYARG_0 = %CONVERTTOPYTHON[QAction*](action);
- Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0,
- const_cast&lt;char *&gt;("connect"),
- const_cast&lt;char *&gt;("OsO"),
- %PYARG_0, SIGNAL(triggered()), %PYARG_2)
- );
- </inject-code>
+ <inject-code file="../glue/qtwidgets.cpp" snippet="qtoolbar-addaction-2"/>
</modify-function>
<modify-function signature="addAction(const QString&amp;)">
<modify-argument index="return">
@@ -3085,9 +2838,7 @@
</modify-argument>
</modify-function>
<add-function signature="addAction(QAction*)">
- <inject-code class="target" position="beginning">
- %CPPSELF.addAction(%1);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qtoolbar-addaction-3"/>
</add-function>
<modify-function signature="addSeparator()">
<modify-argument index="return">
@@ -3116,30 +2867,7 @@
</modify-argument>
</modify-function>
<modify-function signature="clear()">
- <inject-code>
- QList&lt;PyObject* &gt; lst;
- Shiboken::BindingManager&amp; bm = Shiboken::BindingManager::instance();
- foreach(QToolButton* child, %CPPSELF.findChildren&lt;QToolButton*&gt;()) {
- if (bm.hasWrapper(child)) {
- PyObject* pyChild = %CONVERTTOPYTHON[QToolButton*](child);
- Shiboken::Object::setParent(0, pyChild);
- lst &lt;&lt; pyChild;
- }
- }
-
- //Remove actions
- foreach(QAction *act, %CPPSELF.actions()) {
- Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));
- Shiboken::Object::setParent(NULL, pyAct);
- Shiboken::Object::invalidate(pyAct);
- }
-
- %CPPSELF.clear();
- foreach(PyObject* obj, lst) {
- Shiboken::Object::invalidate(reinterpret_cast&lt;SbkObject* &gt;(obj));
- Py_XDECREF(obj);
- }
- </inject-code>
+ <inject-code file="../glue/qtwidgets.cpp" snippet="qtoolbar-clear"/>
</modify-function>
</object-type>
<object-type name="QComboBox">
@@ -3221,22 +2949,15 @@
<include file-name="QLocale" location="global"/>
<include file-name="QStyle" location="global"/>
</extra-includes>
- <modify-function signature="QApplication(int&amp;,char**,int)" access="private" />
+ <modify-function signature="QApplication(int&amp;,char**,int)" access="private"/>
<add-function signature="QApplication(QStringList)">
- <inject-code>
- QApplicationConstructor(%PYSELF, args, &amp;%0);
- </inject-code>
+ <inject-code file="../glue/qtwidgets.cpp" snippet="qapplication-1"/>
</add-function>
<add-function signature="QApplication()">
- <inject-code>
- PyObject *empty = PyTuple_New(2);
- if (!PyTuple_SetItem(empty, 0, PyList_New(0))) {
- QApplicationConstructor(%PYSELF, empty, &amp;%0);
- }
- </inject-code>
+ <inject-code file="../glue/qtwidgets.cpp" snippet="qapplication-2"/>
</add-function>
<modify-function signature="exec()" rename="exec_" allow-thread="yes"/>
- <inject-code class="native" file="glue/qapplication_init.cpp" position="beginning" />
+ <inject-code class="native" file="glue/qapplication_init.cpp" position="beginning"/>
</object-type>
<object-type name="QCommandLinkButton"/>
@@ -3268,7 +2989,7 @@
<modify-function signature="getLayoutPosition(QLayout*,int*,QFormLayout::ItemRole*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="2">
<remove-argument/>
@@ -3282,7 +3003,7 @@
</modify-function>
<modify-function signature="getWidgetPosition(QWidget*,int*,QFormLayout::ItemRole*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="2">
<remove-argument/>
@@ -3296,7 +3017,7 @@
</modify-function>
<modify-function signature="getItemPosition(int,int*,QFormLayout::ItemRole*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="2">
<remove-argument/>
@@ -3417,7 +3138,7 @@
<object-type name="QGraphicsLayout">
<modify-function signature="getContentsMargins(qreal*,qreal*,qreal*,qreal*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -3433,12 +3154,12 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
<inject-code class="native" position="end">
<insert-template name="fix_native_return_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
@@ -3449,7 +3170,7 @@
<object-type name="QGraphicsLayoutItem" copyable="false">
<modify-function signature="getContentsMargins(qreal*,qreal*,qreal*,qreal*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -3465,12 +3186,12 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
<inject-code class="native" position="end">
<insert-template name="fix_native_return_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
@@ -3524,20 +3245,14 @@
</modify-argument>
</modify-function>
<modify-function signature="setWidget(QWidget*)">
- <inject-code>
- QWidget* _old = %CPPSELF.widget();
- if (_old)
- Shiboken::Object::setParent(NULL, %CONVERTTOPYTHON[QWidget*](_old));
- %CPPSELF.%FUNCTION_NAME(%1);
- Shiboken::Object::setParent(%PYSELF, %PYARG_1);
- </inject-code>
+ <inject-code file="../glue/qtwidgets.cpp" snippet="qgraphicsproxywidget-setwidget"/>
</modify-function>
</object-type>
<!-- a QObject so main-thread delete redundant -->
<object-type name="QGraphicsWidget">
<modify-function signature="getContentsMargins(qreal*,qreal*,qreal*,qreal*)const">
<modify-argument index="return">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -3554,13 +3269,13 @@
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getWindowFrameMargins(qreal*,qreal*,qreal*,qreal*)const">
<modify-argument index="return">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -3577,7 +3292,7 @@
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
@@ -3649,7 +3364,7 @@
<parent index="this" action="add"/>
</modify-argument>
</modify-function>
- <modify-function signature="print(QPagedPaintDevice*)const" rename="print_" />
+ <modify-function signature="print(QPagedPaintDevice*)const" rename="print_"/>
</object-type>
<object-type name="QStyledItemDelegate">
<modify-function signature="setItemEditorFactory(QItemEditorFactory*)">
@@ -3733,7 +3448,7 @@
<!-- The above entries may be present in the system or not. Keep this section organized. -->
<!-- This enum is present on QtCore -->
- <suppress-warning text="enum 'QCoreApplication::ApplicationFlags' is specified in typesystem, but not declared" />
+ <suppress-warning text="enum 'QCoreApplication::ApplicationFlags' is specified in typesystem, but not declared"/>
<suppress-warning text="QGraphicsEllipseItem::Type' does not have a type entry or is not an enum"/>
<suppress-warning text="QGraphicsItemGroup::Type' does not have a type entry or is not an enum"/>
<suppress-warning text="QGraphicsItem::UserType' does not have a type entry or is not an enum"/>
diff --git a/sources/pyside2/PySide2/QtXml/typesystem_xml.xml b/sources/pyside2/PySide2/QtXml/typesystem_xml.xml
index 3bfd7c662..4f7839ccf 100644
--- a/sources/pyside2/PySide2/QtXml/typesystem_xml.xml
+++ b/sources/pyside2/PySide2/QtXml/typesystem_xml.xml
@@ -40,18 +40,18 @@
****************************************************************************/
-->
<typesystem package="PySide2.QtXml">
- <load-typesystem name="typesystem_templates.xml" generate="no" />
- <load-typesystem name="QtCore/typesystem_core.xml" generate="no" />
+ <load-typesystem name="typesystem_templates.xml" generate="no"/>
+ <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
<rejection class="QXmlAttributes::Attribute"/>
<rejection class="QDomNode" field-name="impl"/>
<rejection class="QXmlInputSource" field-name="EndOfData"/>
<rejection class="QXmlInputSource" field-name="EndOfDocument"/>
- <value-type name="QDomAttr" />
- <value-type name="QDomCDATASection" />
- <value-type name="QDomCharacterData" />
- <value-type name="QDomComment" />
+ <value-type name="QDomAttr"/>
+ <value-type name="QDomCDATASection"/>
+ <value-type name="QDomCharacterData"/>
+ <value-type name="QDomComment"/>
<template name="qdomdocument_setcontent">
QString _errorMsg_;
@@ -86,7 +86,7 @@
<replace-type modified-type="(retval, errorMsg, errorLine, errorColumn)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="qdomdocument_setcontent" />
+ <insert-template name="qdomdocument_setcontent"/>
</inject-code>
</modify-function>
<modify-function signature="setContent(const QString&amp;,bool,QString*,int*,int*)">
@@ -106,7 +106,7 @@
<replace-type modified-type="(retval, errorMsg, errorLine, errorColumn)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="qdomdocument_setcontent" />
+ <insert-template name="qdomdocument_setcontent"/>
</inject-code>
</modify-function>
<modify-function signature="setContent(QIODevice*,bool,QString*,int*,int*)">
@@ -126,7 +126,7 @@
<replace-type modified-type="(retval, errorMsg, errorLine, errorColumn)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="qdomdocument_setcontent" />
+ <insert-template name="qdomdocument_setcontent"/>
</inject-code>
</modify-function>
<modify-function signature="setContent(const QByteArray&amp;,QString*,int*,int*)">
@@ -146,7 +146,7 @@
<replace-type modified-type="(retval, errorMsg, errorLine, errorColumn)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="qdomdocument_setcontent" />
+ <insert-template name="qdomdocument_setcontent"/>
</inject-code>
</modify-function>
<modify-function signature="setContent(QIODevice*,QString*,int*,int*)">
@@ -166,7 +166,7 @@
<replace-type modified-type="(retval, errorMsg, errorLine, errorColumn)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="qdomdocument_setcontent" />
+ <insert-template name="qdomdocument_setcontent"/>
</inject-code>
</modify-function>
<modify-function signature="setContent(QXmlInputSource*,bool,QString*,int*,int*)">
@@ -186,7 +186,7 @@
<replace-type modified-type="(retval, errorMsg, errorLine, errorColumn)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="qdomdocument_setcontent" />
+ <insert-template name="qdomdocument_setcontent"/>
</inject-code>
</modify-function>
<modify-function signature="setContent(QXmlInputSource*,QXmlReader*,QString*,int*,int*)">
@@ -206,7 +206,7 @@
<replace-type modified-type="(retval, errorMsg, errorLine, errorColumn)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="qdomdocument_setcontent" />
+ <insert-template name="qdomdocument_setcontent"/>
</inject-code>
</modify-function>
<modify-function signature="setContent(const QString&amp;,QString*,int*,int*)">
@@ -226,20 +226,20 @@
<replace-type modified-type="(retval, errorMsg, errorLine, errorColumn)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="qdomdocument_setcontent" />
+ <insert-template name="qdomdocument_setcontent"/>
</inject-code>
</modify-function>
</value-type>
- <value-type name="QDomDocumentFragment" />
- <value-type name="QDomDocumentType" />
- <value-type name="QDomEntity" />
- <value-type name="QDomEntityReference" />
+ <value-type name="QDomDocumentFragment"/>
+ <value-type name="QDomDocumentType"/>
+ <value-type name="QDomEntity"/>
+ <value-type name="QDomEntityReference"/>
<value-type name="QDomImplementation">
<enum-type name="InvalidDataPolicy"/>
</value-type>
- <value-type name="QDomNamedNodeMap" />
+ <value-type name="QDomNamedNodeMap"/>
<value-type name="QDomNode">
<enum-type name="EncodingPolicy"/>
@@ -247,11 +247,11 @@
<modify-function signature="save(QTextStream&amp;,int,QDomNode::EncodingPolicy)const" allow-thread="yes"/>
</value-type>
- <value-type name="QDomNodeList" />
- <value-type name="QDomNotation" />
- <value-type name="QDomProcessingInstruction" />
+ <value-type name="QDomNodeList"/>
+ <value-type name="QDomNotation"/>
+ <value-type name="QDomProcessingInstruction"/>
- <value-type name="QDomText" />
+ <value-type name="QDomText"/>
<object-type name="QXmlParseException"/>
@@ -291,15 +291,7 @@
<insert-template name="QXmlEntityResolver_resolveEntity_return_conversion_native"/>
</conversion-rule>
</modify-argument>
- <inject-code class="target" position="end">
- QXmlInputSource* _qxmlinputsource_arg_ = 0;
- %BEGIN_ALLOW_THREADS
- %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2, _qxmlinputsource_arg_);
- %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[QXmlInputSource*](_qxmlinputsource_arg_));
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtxml.cpp" snippet="qxmlentityresolver-resolveentity"/>
</modify-function>
</object-type>
<object-type name="QXmlDefaultHandler">
@@ -318,15 +310,7 @@
<insert-template name="QXmlEntityResolver_resolveEntity_return_conversion_native"/>
</conversion-rule>
</modify-argument>
- <inject-code class="target" position="end">
- QXmlInputSource* _qxmlinputsource_arg_ = 0;
- %BEGIN_ALLOW_THREADS
- %RETURN_TYPE %0 = %CPPSELF.%TYPE::%FUNCTION_NAME(%1, %2, _qxmlinputsource_arg_);
- %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[QXmlInputSource*](_qxmlinputsource_arg_));
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtxml.cpp" snippet="qxmlentityresolver-resolveentity"/>
</modify-function>
</object-type>
<object-type name="QXmlInputSource"/>
@@ -342,7 +326,7 @@
<remove-argument/>
</modify-argument>
<modify-argument index="return">
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
<conversion-rule class="native">
<insert-template name="fix_virtual_method_return_value_and_bool*"/>
</conversion-rule>
@@ -357,7 +341,7 @@
<remove-argument/>
</modify-argument>
<modify-argument index="return">
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
<conversion-rule class="native">
<insert-template name="fix_virtual_method_return_value_and_bool*"/>
</conversion-rule>
@@ -409,7 +393,7 @@
<remove-argument/>
</modify-argument>
<modify-argument index="return">
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
<conversion-rule class="native">
<insert-template name="fix_virtual_method_return_value_and_bool*"/>
</conversion-rule>
@@ -424,7 +408,7 @@
<remove-argument/>
</modify-argument>
<modify-argument index="return">
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
<conversion-rule class="native">
<insert-template name="fix_virtual_method_return_value_and_bool*"/>
</conversion-rule>
diff --git a/sources/pyside2/PySide2/QtXmlPatterns/typesystem_xmlpatterns.xml b/sources/pyside2/PySide2/QtXmlPatterns/typesystem_xmlpatterns.xml
index 2ac150807..f3f689cf6 100644
--- a/sources/pyside2/PySide2/QtXmlPatterns/typesystem_xmlpatterns.xml
+++ b/sources/pyside2/PySide2/QtXmlPatterns/typesystem_xmlpatterns.xml
@@ -42,83 +42,80 @@
<typesystem package="PySide2.QtXmlPatterns">
<load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
- <object-type name="QXmlSchema" since="4.6" /> <!-- Qt scoped pointer does not allow declare this as value type -->
+ <object-type name="QXmlSchema" since="4.6"/> <!-- Qt scoped pointer does not allow declare this as value type -->
<object-type name="QXmlSchemaValidator" since="4.6">
<modify-function signature="schema()const">
<modify-argument index="return">
<replace-type modified-type="QXmlSchema*"/>
<define-ownership owner="target"/>
</modify-argument>
- <inject-code>
- QXmlSchema* %0 = new QXmlSchema(%CPPSELF.schema());
- %PYARG_0 = %CONVERTTOPYTHON[QXmlSchema*](%0);
- </inject-code>
+ <inject-code file="../glue/qtxmlpatterns.cpp" snippet="qxmlschemavalidator-schema"/>
</modify-function>
</object-type>
- <object-type name="QAbstractMessageHandler" />
- <object-type name="QAbstractUriResolver" />
+ <object-type name="QAbstractMessageHandler"/>
+ <object-type name="QAbstractUriResolver"/>
<object-type name="QAbstractXmlNodeModel">
- <enum-type name="NodeCopySetting" />
- <enum-type name="SimpleAxis" />
+ <enum-type name="NodeCopySetting"/>
+ <enum-type name="SimpleAxis"/>
</object-type>
- <object-type name="QAbstractXmlReceiver" />
- <value-type name="QSourceLocation" />
- <object-type name="QXmlFormatter" />
- <value-type name="QXmlItem" />
+ <object-type name="QAbstractXmlReceiver"/>
+ <value-type name="QSourceLocation"/>
+ <object-type name="QXmlFormatter"/>
+ <value-type name="QXmlItem"/>
<value-type name="QXmlName">
<primitive-type name="NamespaceCode"/>
<primitive-type name="PrefixCode"/>
<primitive-type name="LocalNameCode"/>
<!-- ### These methods aren't part of Qt public API -->
<modify-function signature="QXmlName(QXmlName::NamespaceCode,QXmlName::LocalNameCode,QXmlName::PrefixCode)" remove="all"/>
- <modify-function signature="setNamespaceURI(QXmlName::NamespaceCode)" remove="all" />
- <modify-function signature="localName()const" remove="all" />
- <modify-function signature="prefix()const" remove="all" />
- <modify-function signature="hasPrefix()const" remove="all" />
- <modify-function signature="hasNamespace()const" remove="all" />
- <modify-function signature="namespaceURI()const" remove="all" />
- <modify-function signature="isLexicallyEqual(const QXmlName&amp;)const" remove="all" />
- <modify-function signature="setPrefix(QXmlName::PrefixCode)" remove="all" />
- <modify-function signature="setLocalName(QXmlName::LocalNameCode)" remove="all" />
- <modify-function signature="code()const" remove="all" />
+ <modify-function signature="setNamespaceURI(QXmlName::NamespaceCode)" remove="all"/>
+ <modify-function signature="localName()const" remove="all"/>
+ <modify-function signature="prefix()const" remove="all"/>
+ <modify-function signature="hasPrefix()const" remove="all"/>
+ <modify-function signature="hasNamespace()const" remove="all"/>
+ <modify-function signature="namespaceURI()const" remove="all"/>
+ <modify-function signature="isLexicallyEqual(const QXmlName&amp;)const" remove="all"/>
+ <modify-function signature="setPrefix(QXmlName::PrefixCode)" remove="all"/>
+ <modify-function signature="setLocalName(QXmlName::LocalNameCode)" remove="all"/>
+ <modify-function signature="code()const" remove="all"/>
<!-- ### -->
</value-type>
- <value-type name="QXmlNamePool" />
+ <value-type name="QXmlNamePool"/>
- <rejection class="QXmlNodeModelIndex" function-name="type" />
- <rejection class="QXmlNodeModelIndex" function-name="sequencedTypedValue" />
- <rejection class="QXmlNodeModelIndex" function-name="iterate" />
+ <rejection class="QXmlNodeModelIndex" function-name="type"/>
+ <rejection class="QXmlNodeModelIndex" function-name="sequencedTypedValue"/>
+ <rejection class="QXmlNodeModelIndex" function-name="iterate"/>
<!-- ### This enum isn't part of Qt public API -->
<suppress-warning text="enum 'QXmlNodeModelIndex::Axis' does not have a type entry or is not an enum"/>
<value-type name="QXmlNodeModelIndex">
- <enum-type name="DocumentOrder" />
- <enum-type name="NodeKind" />
+ <enum-type name="DocumentOrder"/>
+ <enum-type name="NodeKind"/>
<!-- ### Qt internal methods -->
- <modify-function signature="name()const" remove="all" />
- <modify-function signature="root()const" remove="all" />
- <modify-function signature="documentUri()const" remove="all" />
- <modify-function signature="baseUri()const" remove="all" />
- <modify-function signature="kind()const" remove="all" />
- <modify-function signature="isDeepEqual(const QXmlNodeModelIndex&amp;)const" remove="all" />
- <modify-function signature="compareOrder(const QXmlNodeModelIndex &amp;)const" remove="all" />
- <modify-function signature="sendNamespaces(QAbstractXmlReceiver*const)const" remove="all" />
- <modify-function signature="namespaceBindings()const" remove="all" />
- <modify-function signature="namespaceForPrefix(QXmlName::PrefixCode)const" remove="all" />
- <modify-function signature="stringValue()const" remove="all" />
- <modify-function signature="is(const QXmlNodeModelIndex &amp;)const" remove="all" />
- <modify-function signature="reset()" remove="all" />
+ <modify-function signature="name()const" remove="all"/>
+ <modify-function signature="root()const" remove="all"/>
+ <modify-function signature="documentUri()const" remove="all"/>
+ <modify-function signature="baseUri()const" remove="all"/>
+ <modify-function signature="kind()const" remove="all"/>
+ <modify-function signature="isDeepEqual(const QXmlNodeModelIndex&amp;)const" remove="all"/>
+ <modify-function signature="compareOrder(const QXmlNodeModelIndex &amp;)const" remove="all"/>
+ <modify-function signature="sendNamespaces(QAbstractXmlReceiver*const)const" remove="all"/>
+ <modify-function signature="namespaceBindings()const" remove="all"/>
+ <modify-function signature="namespaceForPrefix(QXmlName::PrefixCode)const" remove="all"/>
+ <modify-function signature="stringValue()const" remove="all"/>
+ <modify-function signature="is(const QXmlNodeModelIndex &amp;)const" remove="all"/>
+ <modify-function signature="reset()" remove="all"/>
<!-- ### -->
</value-type>
<value-type name="QXmlQuery">
<!-- ### TODO: must evaluate if anything other than removal is needed. -->
- <enum-type name="QueryLanguage" />
- <modify-function signature="evaluateTo(QStringList*)const" remove="all" />
- <modify-function signature="evaluateTo(QString*)const" remove="all" />
+ <enum-type name="QueryLanguage"/>
+ <modify-function signature="evaluateTo(QStringList*)const" remove="all"/>
+ <modify-function signature="evaluateTo(QString*)const" remove="all"/>
<!-- ### -->
</value-type>
- <object-type name="QXmlResultItems" />
- <object-type name="QXmlSerializer" />
+ <object-type name="QXmlResultItems"/>
+ <object-type name="QXmlSerializer"/>
<suppress-warning text="class 'QAbstractXmlNodeModel' inherits from unknown base class 'QSharedData'"/>
<suppress-warning text="class not found for setup inheritance 'QSharedData'"/>
diff --git a/sources/pyside2/PySide2/glue/qtcharts.cpp b/sources/pyside2/PySide2/glue/qtcharts.cpp
new file mode 100644
index 000000000..1828fecc0
--- /dev/null
+++ b/sources/pyside2/PySide2/glue/qtcharts.cpp
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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$
+**
+****************************************************************************/
+
+// @snippet qchart-releaseownership
+Shiboken::Object::releaseOwnership(%PYARG_1);
+// @snippet qchart-releaseownership
diff --git a/sources/pyside2/PySide2/glue/qtcore.cpp b/sources/pyside2/PySide2/glue/qtcore.cpp
new file mode 100644
index 000000000..f4114db3f
--- /dev/null
+++ b/sources/pyside2/PySide2/glue/qtcore.cpp
@@ -0,0 +1,1010 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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$
+**
+****************************************************************************/
+
+// @snippet include-pyside
+#include <pyside.h>
+// @snippet include-pyside
+
+// @snippet pystring-check
+bool py2kStrCheck(PyObject *obj)
+{
+#ifdef IS_PY3K
+ return false;
+#else
+ return PyString_Check(obj);
+#endif
+}
+// @snippet pystring-check
+
+// @snippet qvariant-conversion
+static const char *QVariant_resolveMetaType(PyTypeObject *type, int *typeId)
+{
+ if (PyObject_TypeCheck(type, SbkObjectType_TypeF())) {
+ SbkObjectType* sbkType = (SbkObjectType*)type;
+ const char* typeName = Shiboken::ObjectType::getOriginalName(sbkType);
+ if (!typeName)
+ return nullptr;
+ const bool valueType = '*' != typeName[qstrlen(typeName) - 1];
+ // Do not convert user type of value
+ if (valueType && Shiboken::ObjectType::isUserType(type))
+ return nullptr;
+ int obTypeId = QMetaType::type(typeName);
+ if (obTypeId) {
+ *typeId = obTypeId;
+ return typeName;
+ }
+ // Do not resolve types to value type
+ if (valueType)
+ return 0;
+ // Find in base types. First check tp_bases, and only after check tp_base, because
+ // tp_base does not always point to the first base class, but rather to the first
+ // that has added any python fields or slots to its object layout.
+ // See https://mail.python.org/pipermail/python-list/2009-January/520733.html
+ if (type->tp_bases) {
+ for (int i = 0, size = PyTuple_GET_SIZE(type->tp_bases); i < size; ++i) {
+ const char *derivedName = QVariant_resolveMetaType(reinterpret_cast<PyTypeObject *>(PyTuple_GET_ITEM(
+ type->tp_bases, i)), typeId);
+ if (derivedName)
+ return derivedName;
+ }
+ }
+ else if (type->tp_base) {
+ return QVariant_resolveMetaType(type->tp_base, typeId);
+ }
+ }
+ *typeId = 0;
+ return 0;
+}
+static QVariant QVariant_convertToValueList(PyObject *list)
+{
+ if (PySequence_Size(list) < 0) {
+ // clear the error if < 0 which means no length at all
+ PyErr_Clear();
+ return QVariant();
+ }
+
+ Shiboken::AutoDecRef element(PySequence_GetItem(list, 0));
+ int typeId;
+ const char *typeName = QVariant_resolveMetaType(element.cast<PyTypeObject*>(), &typeId);
+ if (typeName) {
+ QByteArray listTypeName("QList<");
+ listTypeName += typeName;
+ listTypeName += '>';
+ typeId = QMetaType::type(listTypeName);
+ if (typeId > 0) {
+ Shiboken::Conversions::SpecificConverter converter(listTypeName);
+ if (converter) {
+ QVariant var(typeId, nullptr);
+ converter.toCpp(list, &var);
+ return var;
+ }
+ qWarning() << "Type converter for :" << listTypeName << "not registered.";
+ }
+ }
+ return QVariant();
+}
+static bool QVariant_isStringList(PyObject *list)
+{
+ if (!PySequence_Check(list)) {
+ // If it is not a list or a derived list class
+ // we assume that will not be a String list neither.
+ return false;
+ }
+
+ if (PySequence_Size(list) < 0) {
+ // clear the error if < 0 which means no length at all
+ PyErr_Clear();
+ return false;
+ }
+
+ Shiboken::AutoDecRef fast(PySequence_Fast(list, "Failed to convert QVariantList"));
+ const Py_ssize_t size = PySequence_Fast_GET_SIZE(fast.object());
+ for (Py_ssize_t i = 0; i < size; ++i) {
+ PyObject *item = PySequence_Fast_GET_ITEM(fast.object(), i);
+ if (!%CHECKTYPE[QString](item))
+ return false;
+ }
+ return true;
+}
+static QVariant QVariant_convertToVariantMap(PyObject *map)
+{
+ Py_ssize_t pos = 0;
+ Shiboken::AutoDecRef keys(PyDict_Keys(map));
+ if (!QVariant_isStringList(keys))
+ return QVariant();
+ PyObject *key;
+ PyObject *value;
+ QMap<QString,QVariant> ret;
+ while (PyDict_Next(map, &pos, &key, &value)) {
+ QString cppKey = %CONVERTTOCPP[QString](key);
+ QVariant cppValue = %CONVERTTOCPP[QVariant](value);
+ ret.insert(cppKey, cppValue);
+ }
+ return QVariant(ret);
+}
+static QVariant QVariant_convertToVariantList(PyObject *list)
+{
+ if (QVariant_isStringList(list)) {
+ QList<QString > lst = %CONVERTTOCPP[QList<QString>](list);
+ return QVariant(QStringList(lst));
+ }
+ QVariant valueList = QVariant_convertToValueList(list);
+ if (valueList.isValid())
+ return valueList;
+
+ if (PySequence_Size(list) < 0) {
+ // clear the error if < 0 which means no length at all
+ PyErr_Clear();
+ return QVariant();
+ }
+
+ QList<QVariant> lst;
+ Shiboken::AutoDecRef fast(PySequence_Fast(list, "Failed to convert QVariantList"));
+ const Py_ssize_t size = PySequence_Fast_GET_SIZE(fast.object());
+ for (Py_ssize_t i = 0; i < size; ++i) {
+ PyObject *pyItem = PySequence_Fast_GET_ITEM(fast.object(), i);
+ QVariant item = %CONVERTTOCPP[QVariant](pyItem);
+ lst.append(item);
+ }
+ return QVariant(lst);
+}
+// @snippet qvariant-conversion
+
+// @snippet qvariantmap-register
+Shiboken::Conversions::registerConverterName(SbkPySide2_QtCoreTypeConverters[SBK_QTCORE_QMAP_QSTRING_QVARIANT_IDX], "QVariantMap");
+// @snippet qvariantmap-register
+
+// @snippet qvariantmap-check
+static bool QVariantType_isStringList(PyObject *list)
+{
+ Shiboken::AutoDecRef fast(PySequence_Fast(list, "Failed to convert QVariantList"));
+ const Py_ssize_t size = PySequence_Fast_GET_SIZE(fast.object());
+ for (Py_ssize_t i=0; i < size; i++) {
+ PyObject *item = PySequence_Fast_GET_ITEM(fast.object(), i);
+ if (!%CHECKTYPE[QString](item))
+ return false;
+ }
+ return true;
+}
+static bool QVariantType_checkAllStringKeys(PyObject *dict)
+{
+ Shiboken::AutoDecRef keys(PyDict_Keys(dict));
+ return QVariantType_isStringList(keys);
+}
+// @snippet qvariantmap-check
+
+// @snippet qt-qabs
+double _abs = qAbs(%1);
+%PYARG_0 = %CONVERTTOPYTHON[double](_abs);
+// @snippet qt-qabs
+
+// @snippet qt-postroutine
+namespace PySide {
+static QStack<PyObject*> globalPostRoutineFunctions;
+void globalPostRoutineCallback()
+{
+ Shiboken::GilState state;
+ foreach (PyObject *callback, globalPostRoutineFunctions) {
+ Shiboken::AutoDecRef result(PyObject_CallObject(callback, NULL));
+ Py_DECREF(callback);
+ }
+ globalPostRoutineFunctions.clear();
+}
+void addPostRoutine(PyObject *callback)
+{
+ if (PyCallable_Check(callback)) {
+ globalPostRoutineFunctions << callback;
+ Py_INCREF(callback);
+ } else {
+ PyErr_SetString(PyExc_TypeError, "qAddPostRoutine: The argument must be a callable object.");
+ }
+}
+} // namespace
+// @snippet qt-postroutine
+
+// @snippet qt-addpostroutine
+PySide::addPostRoutine(%1);
+// @snippet qt-addpostroutine
+
+// @snippet qt-qaddpostroutine
+qAddPostRoutine(PySide::globalPostRoutineCallback);
+// @snippet qt-qaddpostroutine
+
+// @snippet qt-version
+QList<QByteArray> version = QByteArray(qVersion()).split('.');
+PyObject *pyQtVersion = PyTuple_New(3);
+for (int i = 0; i < 3; ++i)
+ PyTuple_SET_ITEM(pyQtVersion, i, PyInt_FromLong(version[i].toInt()));
+PyModule_AddObject(module, "__version_info__", pyQtVersion);
+PyModule_AddStringConstant(module, "__version__", qVersion());
+// @snippet qt-version
+
+// @snippet qobject-connect-1
+// %FUNCTION_NAME() - disable generation of function call.
+bool %0 = qobjectConnect(%1, %2, %CPPSELF, %3, %4);
+%PYARG_0 = %CONVERTTOPYTHON[bool](%0);
+// @snippet qobject-connect-1
+
+// @snippet qobject-connect-2
+// %FUNCTION_NAME() - disable generation of function call.
+bool %0 = qobjectConnect(%1, %2, %3, %4, %5);
+%PYARG_0 = %CONVERTTOPYTHON[bool](%0);
+// @snippet qobject-connect-2
+
+// @snippet qobject-connect-3
+// %FUNCTION_NAME() - disable generation of function call.
+bool %0 = qobjectConnect(%1, %2, %3, %4, %5);
+%PYARG_0 = %CONVERTTOPYTHON[bool](%0);
+// @snippet qobject-connect-3
+
+// @snippet qobject-connect-4
+// %FUNCTION_NAME() - disable generation of function call.
+%RETURN_TYPE %0 = qobjectConnectCallback(%1, %2, %PYARG_3, %4);
+%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+// @snippet qobject-connect-4
+
+// @snippet qobject-connect-5
+// %FUNCTION_NAME() - disable generation of function call.
+%RETURN_TYPE %0 = qobjectConnectCallback(%CPPSELF, %1, %PYARG_2, %3);
+%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+// @snippet qobject-connect-5
+
+// @snippet qobject-connect-6
+// %FUNCTION_NAME() - disable generation of function call.
+%RETURN_TYPE %0 = qobjectConnect(%CPPSELF, %1, %2, %3, %4);
+%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+// @snippet qobject-connect-6
+
+// @snippet qobject-emit
+%RETURN_TYPE %0 = PySide::SignalManager::instance().emitSignal(%CPPSELF, %1, %PYARG_2);
+%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+// @snippet qobject-emit
+
+// @snippet qobject-disconnect-1
+// %FUNCTION_NAME() - disable generation of function call.
+%RETURN_TYPE %0 = qobjectDisconnectCallback(%CPPSELF, %1, %2);
+%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+// @snippet qobject-disconnect-1
+
+// @snippet qobject-disconnect-2
+// %FUNCTION_NAME() - disable generation of function call.
+%RETURN_TYPE %0 = qobjectDisconnectCallback(%1, %2, %3);
+%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+// @snippet qobject-disconnect-2
+
+// @snippet qfatal
+// qFatal doesn't have a stream version, so we do a
+// qWarning call followed by a qFatal() call using a
+// literal.
+qWarning() << %1;
+qFatal("[A qFatal() call was made from Python code]");
+// @snippet qfatal
+
+// @snippet moduleshutdown
+PySide::runCleanupFunctions();
+// @snippet moduleshutdown
+
+// @snippet qt-pysideinit
+Shiboken::Conversions::registerConverterName(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], "unicode");
+Shiboken::Conversions::registerConverterName(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], "str");
+Shiboken::Conversions::registerConverterName(SbkPySide2_QtCoreTypeConverters[SBK_QTCORE_QLIST_QVARIANT_IDX], "QVariantList");
+
+PySide::registerInternalQtConf();
+PySide::init(module);
+Py_AtExit(QtCoreModuleExit);
+// @snippet qt-pysideinit
+
+// @snippet qt-messagehandler
+// Define a global variable to handle qInstallMessageHandler callback
+static PyObject *qtmsghandler = nullptr;
+
+static void msgHandlerCallback(QtMsgType type, const QMessageLogContext &ctx, const QString &msg)
+{
+ Shiboken::GilState state;
+ Shiboken::AutoDecRef arglist(PyTuple_New(3));
+ PyTuple_SET_ITEM(arglist, 0, %CONVERTTOPYTHON[QtMsgType](type));
+ PyTuple_SET_ITEM(arglist, 1, %CONVERTTOPYTHON[QMessageLogContext &](ctx));
+ QByteArray array = msg.toLocal8Bit();
+ char *data = array.data();
+ PyTuple_SET_ITEM(arglist, 2, %CONVERTTOPYTHON[char *](data));
+ Shiboken::AutoDecRef ret(PyObject_CallObject(qtmsghandler, arglist));
+}
+static void QtCoreModuleExit()
+{
+ PySide::SignalManager::instance().clear();
+}
+// @snippet qt-messagehandler
+
+// @snippet qt-installmessagehandler
+if (%PYARG_1 == Py_None) {
+ qInstallMessageHandler(0);
+ %PYARG_0 = qtmsghandler ? qtmsghandler : Py_None;
+ qtmsghandler = 0;
+} else if (!PyCallable_Check(%PYARG_1)) {
+ PyErr_SetString(PyExc_TypeError, "parameter must be callable");
+} else {
+ %PYARG_0 = qtmsghandler ? qtmsghandler : Py_None;
+ Py_INCREF(%PYARG_1);
+ qtmsghandler = %PYARG_1;
+ qInstallMessageHandler(msgHandlerCallback);
+}
+
+if (%PYARG_0 == Py_None)
+ Py_INCREF(%PYARG_0);
+// @snippet qt-installmessagehandler
+
+// @snippet qline-hash
+namespace PySide {
+ template<> inline uint hash(const QLine &v) {
+ return qHash(qMakePair(qMakePair(v.x1(), v.y1()), qMakePair(v.x2(), v.y2())));
+ }
+};
+// @snippet qline-hash
+
+// @snippet qlinef-intersect
+QPointF p;
+%RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &p);
+%PYARG_0 = PyTuple_New(2);
+PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval));
+PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QPointF](p));
+// @snippet qlinef-intersect
+
+// @snippet qresource-data
+const void *d = %CPPSELF.%FUNCTION_NAME();
+if (d) {
+ %PYARG_0 = Shiboken::Buffer::newObject(d, %CPPSELF.size());
+} else {
+ Py_INCREF(Py_None);
+ %PYARG_0 = Py_None;
+}
+// @snippet qresource-data
+
+// @snippet qdate-topython
+if (!PyDateTimeAPI)
+ PySideDateTime_IMPORT;
+%PYARG_0 = PyDate_FromDate(%CPPSELF.year(), %CPPSELF.month(), %CPPSELF.day());
+// @snippet qdate-topython
+
+// @snippet qdate-getdate
+int year, month, day;
+%BEGIN_ALLOW_THREADS
+%CPPSELF.%FUNCTION_NAME(&year, &month, &day);
+%END_ALLOW_THREADS
+%PYARG_0 = PyTuple_New(3);
+PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](year));
+PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](month));
+PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](day));
+// @snippet qdate-getdate
+
+// @snippet qdate-weeknumber
+int yearNumber;
+%BEGIN_ALLOW_THREADS
+int week = %CPPSELF.%FUNCTION_NAME(&yearNumber);
+%END_ALLOW_THREADS
+%PYARG_0 = PyTuple_New(2);
+PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](week));
+PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](yearNumber));
+// @snippet qdate-weeknumber
+
+// @snippet qdatetime-1
+QDate date(%1, %2, %3);
+QTime time(%4, %5, %6, %7);
+%0 = new %TYPE(date, time, Qt::TimeSpec(%8));
+// @snippet qdatetime-1
+
+// @snippet qdatetime-2
+QDate date(%1, %2, %3);
+QTime time(%4, %5, %6);
+%0 = new %TYPE(date, time);
+// @snippet qdatetime-2
+
+// @snippet qdatetime-topython
+QDate date = %CPPSELF.date();
+QTime time = %CPPSELF.time();
+if (!PyDateTimeAPI) PySideDateTime_IMPORT;
+%PYARG_0 = PyDateTime_FromDateAndTime(date.year(), date.month(), date.day(), time.hour(), time.minute(), time.second(), time.msec()*1000);
+// @snippet qdatetime-topython
+
+// @snippet qpoint
+namespace PySide {
+ template<> inline uint hash(const QPoint &v) {
+ return qHash(qMakePair(v.x(), v.y()));
+ }
+};
+// @snippet qpoint
+
+// @snippet qrect
+namespace PySide {
+ template<> inline uint hash(const QRect &v) {
+ return qHash(qMakePair(qMakePair(v.x(), v.y()), qMakePair(v.width(), v.height())));
+ }
+};
+// @snippet qrect
+
+// @snippet qsize
+namespace PySide {
+ template<> inline uint hash(const QSize &v) {
+ return qHash(qMakePair(v.width(), v.height()));
+ }
+};
+// @snippet qsize
+
+// @snippet qtime-topython
+if (!PyDateTimeAPI)
+ PySideDateTime_IMPORT;
+%PYARG_0 = PyTime_FromTime(%CPPSELF.hour(), %CPPSELF.minute(), %CPPSELF.second(), %CPPSELF.msec()*1000);
+// @snippet qtime-topython
+
+// @snippet qbitarray-len
+return %CPPSELF.size();
+// @snippet qbitarray-len
+
+// @snippet qbitarray-getitem
+if (_i < 0 || _i >= %CPPSELF.size()) {
+ PyErr_SetString(PyExc_IndexError, "index out of bounds");
+ return 0;
+}
+bool ret = %CPPSELF.at(_i);
+return %CONVERTTOPYTHON[bool](ret);
+// @snippet qbitarray-getitem
+
+// @snippet qbitarray-setitem
+PyObject *args = Py_BuildValue("(iiO)", _i, 1, _value);
+PyObject *result = Sbk_QBitArrayFunc_setBit(self, args);
+Py_DECREF(args);
+Py_XDECREF(result);
+return !result ? -1 : 0;
+// @snippet qbitarray-setitem
+
+// @snippet unlock
+%CPPSELF.unlock();
+// @snippet unlock
+
+// @snippet qabstractitemmodel-createindex
+%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2, %PYARG_3);
+%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+// @snippet qabstractitemmodel-createindex
+
+// @snippet qabstractitemmodel
+qRegisterMetaType<QVector<int> >("QVector<int>");
+// @snippet qabstractitemmodel
+
+// @snippet qobject-metaobject
+%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME();
+%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+// @snippet qobject-metaobject
+
+// @snippet qobject-findchild
+QObject *child = _findChildHelper(%CPPSELF, %2, (PyTypeObject*)%PYARG_1);
+%PYARG_0 = %CONVERTTOPYTHON[QObject*](child);
+// @snippet qobject-findchild
+
+// @snippet qobject-findchildren-1
+%PYARG_0 = PyList_New(0);
+_findChildrenHelper(%CPPSELF, %2, (PyTypeObject*)%PYARG_1, %PYARG_0);
+// @snippet qobject-findchildren-1
+
+// @snippet qobject-findchildren-2
+%PYARG_0 = PyList_New(0);
+_findChildrenHelper(%CPPSELF, %2, (PyTypeObject*)%PYARG_1, %PYARG_0);
+// @snippet qobject-findchildren-2
+
+// @snippet qobject-tr
+QString result;
+if (QCoreApplication::instance()) {
+ PyObject *klass = PyObject_GetAttrString(%PYSELF, "__class__");
+ PyObject *cname = PyObject_GetAttrString(klass, "__name__");
+ result = QString(QCoreApplication::instance()->translate(Shiboken::String::toCString(cname),
+ /* %1, %2, QCoreApplication::CodecForTr, %3)); */
+ %1, %2, %3));
+
+ Py_DECREF(klass);
+ Py_DECREF(cname);
+} else {
+ result = QString(QString::fromLatin1(%1));
+}
+%PYARG_0 = %CONVERTTOPYTHON[QString](result);
+// @snippet qobject-tr
+
+// @snippet qobject-receivers
+// Avoid return +1 because SignalManager connect to "destroyed()" signal to control object timelife
+int ret = %CPPSELF.%FUNCTION_NAME(%1);
+if (ret > 0 && ((strcmp(%1, SIGNAL(destroyed())) == 0) || (strcmp(%1, SIGNAL(destroyed(QObject*))) == 0)))
+ ret -= PySide::SignalManager::instance().countConnectionsWith(%CPPSELF);
+
+%PYARG_0 = %CONVERTTOPYTHON[int](ret);
+// @snippet qobject-receivers
+
+// @snippet qregexp-replace
+%1.replace(*%CPPSELF, %2);
+%PYARG_0 = %CONVERTTOPYTHON[QString](%1);
+// @snippet qregexp-replace
+
+// @snippet qbytearray-operatorplus-1
+QByteArray ba = QByteArray(PyBytes_AS_STRING(%PYARG_1), PyBytes_GET_SIZE(%PYARG_1)) + *%CPPSELF;
+%PYARG_0 = %CONVERTTOPYTHON[QByteArray](ba);
+// @snippet qbytearray-operatorplus-1
+
+// @snippet qbytearray-operatorplus-2
+QByteArray ba = QByteArray(PyByteArray_AsString(%PYARG_1), PyByteArray_Size(%PYARG_1)) + *%CPPSELF;
+%PYARG_0 = %CONVERTTOPYTHON[QByteArray](ba);
+// @snippet qbytearray-operatorplus-2
+
+// @snippet qbytearray-operatorplus-3
+QByteArray ba = *%CPPSELF + QByteArray(PyByteArray_AsString(%PYARG_1), PyByteArray_Size(%PYARG_1));
+%PYARG_0 = %CONVERTTOPYTHON[QByteArray](ba);
+// @snippet qbytearray-operatorplus-3
+
+// @snippet qbytearray-operatorplusequal
+*%CPPSELF += QByteArray(PyByteArray_AsString(%PYARG_1), PyByteArray_Size(%PYARG_1));
+// @snippet qbytearray-operatorplusequal
+
+// @snippet qbytearray-operatorequalequal
+if (PyUnicode_CheckExact(%PYARG_1)) {
+ Shiboken::AutoDecRef data(PyUnicode_AsASCIIString(%PYARG_1));
+ QByteArray ba = QByteArray(PyBytes_AsString(data.object()), PyBytes_GET_SIZE(data.object()));
+ bool cppResult = %CPPSELF == ba;
+ %PYARG_0 = %CONVERTTOPYTHON[bool](cppResult);
+}
+// @snippet qbytearray-operatorequalequal
+
+// @snippet qbytearray-operatornotequal
+if (PyUnicode_CheckExact(%PYARG_1)) {
+ Shiboken::AutoDecRef data(PyUnicode_AsASCIIString(%PYARG_1));
+ QByteArray ba = QByteArray(PyBytes_AsString(data.object()), PyBytes_GET_SIZE(data.object()));
+ bool cppResult = %CPPSELF != ba;
+ %PYARG_0 = %CONVERTTOPYTHON[bool](cppResult);
+}
+// @snippet qbytearray-operatornotequal
+
+// @snippet qbytearray-operatorgreater
+if (PyUnicode_CheckExact(%PYARG_1)) {
+ Shiboken::AutoDecRef data(PyUnicode_AsASCIIString(%PYARG_1));
+ QByteArray ba = QByteArray(PyBytes_AsString(data.object()), PyBytes_GET_SIZE(data.object()));
+ bool cppResult = %CPPSELF > ba;
+ %PYARG_0 = %CONVERTTOPYTHON[bool](cppResult);
+}
+// @snippet qbytearray-operatorgreater
+
+// @snippet qbytearray-operatorgreaterequal
+if (PyUnicode_CheckExact(%PYARG_1)) {
+ Shiboken::AutoDecRef data(PyUnicode_AsASCIIString(%PYARG_1));
+ QByteArray ba = QByteArray(PyBytes_AsString(data.object()), PyBytes_GET_SIZE(data.object()));
+ bool cppResult = %CPPSELF >= ba;
+ %PYARG_0 = %CONVERTTOPYTHON[bool](cppResult);
+}
+// @snippet qbytearray-operatorgreaterequal
+
+// @snippet qbytearray-operatorlower
+if (PyUnicode_CheckExact(%PYARG_1)) {
+ Shiboken::AutoDecRef data(PyUnicode_AsASCIIString(%PYARG_1));
+ QByteArray ba = QByteArray(PyBytes_AsString(data.object()), PyBytes_GET_SIZE(data.object()));
+ bool cppResult = %CPPSELF < ba;
+ %PYARG_0 = %CONVERTTOPYTHON[bool](cppResult);
+}
+// @snippet qbytearray-operatorlower
+
+// @snippet qbytearray-operatorlowerequal
+if (PyUnicode_CheckExact(%PYARG_1)) {
+ Shiboken::AutoDecRef data(PyUnicode_AsASCIIString(%PYARG_1));
+ QByteArray ba = QByteArray(PyBytes_AsString(data.object()), PyBytes_GET_SIZE(data.object()));
+ bool cppResult = %CPPSELF <= ba;
+ %PYARG_0 = %CONVERTTOPYTHON[bool](cppResult);
+}
+// @snippet qbytearray-operatorlowerequal
+
+// @snippet qbytearray-repr
+PyObject *aux = PyBytes_FromStringAndSize(%CPPSELF.constData(), %CPPSELF.size());
+if (aux == NULL) {
+ return NULL;
+}
+QByteArray b(Py_TYPE(%PYSELF)->tp_name);
+#ifdef IS_PY3K
+ %PYARG_0 = PyUnicode_FromFormat("%s(%R)", b.constData(), aux);
+#else
+ aux = PyObject_Repr(aux);
+ b += '(';
+ b += QByteArray(PyBytes_AS_STRING(aux), PyBytes_GET_SIZE(aux));
+ b += ')';
+ %PYARG_0 = Shiboken::String::fromStringAndSize(b.constData(), b.size());
+#endif
+Py_DECREF(aux);
+// @snippet qbytearray-repr
+
+// @snippet qbytearray-1
+if (PyBytes_Check(%PYARG_1)) {
+ %0 = new QByteArray(PyBytes_AsString(%PYARG_1), PyBytes_GET_SIZE(%PYARG_1));
+} else if (Shiboken::String::check(%PYARG_1)) {
+ %0 = new QByteArray(Shiboken::String::toCString(%PYARG_1), Shiboken::String::len(%PYARG_1));
+}
+// @snippet qbytearray-1
+
+// @snippet qbytearray-2
+%0 = new QByteArray(PyByteArray_AsString(%PYARG_1), PyByteArray_Size(%PYARG_1));
+// @snippet qbytearray-2
+
+// @snippet qbytearray-3
+%0 = new QByteArray(PyBytes_AS_STRING(%PYARG_1), PyBytes_GET_SIZE(%PYARG_1));
+// @snippet qbytearray-3
+
+// @snippet qbytearray-py3
+#if PY_VERSION_HEX < 0x03000000
+ Shiboken::SbkType<QByteArray>()->tp_as_buffer = &SbkQByteArrayBufferProc;
+ Shiboken::SbkType<QByteArray>()->tp_flags |= Py_TPFLAGS_HAVE_GETCHARBUFFER;
+#endif
+// @snippet qbytearray-py3
+
+// @snippet qbytearray-data
+%PYARG_0 = PyBytes_FromStringAndSize(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.size());
+// @snippet qbytearray-data
+
+// @snippet qbytearray-fromrawdata
+%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(PyBytes_AsString(%PYARG_1), PyBytes_GET_SIZE(%PYARG_1));
+%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+// @snippet qbytearray-fromrawdata
+
+// @snippet qbytearray-str
+PyObject *aux = PyBytes_FromStringAndSize(%CPPSELF.constData(), %CPPSELF.size());
+if (aux == NULL) {
+ return NULL;
+}
+#ifdef IS_PY3K
+ %PYARG_0 = PyObject_Repr(aux);
+ Py_DECREF(aux);
+#else
+ %PYARG_0 = aux;
+#endif
+// @snippet qbytearray-str
+
+// @snippet qbytearray-len
+return %CPPSELF.count();
+// @snippet qbytearray-len
+
+// @snippet qbytearray-getitem
+if (_i < 0 || _i >= %CPPSELF.size()) {
+ PyErr_SetString(PyExc_IndexError, "index out of bounds");
+ return 0;
+} else {
+ char res[2];
+ res[0] = %CPPSELF.at(_i);
+ res[1] = 0;
+ return PyBytes_FromStringAndSize(res, 1);
+}
+// @snippet qbytearray-getitem
+
+// @snippet qbytearray-setitem
+%CPPSELF.remove(_i, 1);
+PyObject *args = Py_BuildValue("(nO)", _i, _value);
+PyObject *result = Sbk_QByteArrayFunc_insert(self, args);
+Py_DECREF(args);
+Py_XDECREF(result);
+return !result ? -1 : 0;
+// @snippet qbytearray-setitem
+
+// @snippet qfiledevice-unmap
+uchar *ptr = reinterpret_cast<uchar*>(Shiboken::Buffer::getPointer(%PYARG_1));
+%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(ptr);
+%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+// @snippet qfiledevice-unmap
+
+// @snippet qfiledevice-map
+%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1, %2, %3), %2, Shiboken::Buffer::ReadWrite);
+// @snippet qfiledevice-map
+
+// @snippet qiodevice-readdata
+QByteArray ba(1 + int(%2), char(0));
+%CPPSELF.%FUNCTION_NAME(ba.data(), int(%2));
+%PYARG_0 = Shiboken::String::fromCString(ba.constData());
+// @snippet qiodevice-readdata
+
+// @snippet qcryptographichash-adddata
+%CPPSELF.%FUNCTION_NAME(Shiboken::String::toCString(%PYARG_1), Shiboken::String::len(%PYARG_1));
+// @snippet qcryptographichash-adddata
+
+// @snippet qsocketnotifier
+Shiboken::AutoDecRef socket(%PYARG_1);
+if (!socket.isNull()) {
+ // We use qintptr as PyLong, but we check for int
+ // since it is currently an alias to be Python2 compatible.
+ // Internally, ints are qlonglongs.
+ if (%CHECKTYPE[int](socket)) {
+ int cppSocket = %CONVERTTOCPP[int](socket);
+ qintptr socket = (qintptr)cppSocket;
+ %0 = new %TYPE(socket, %2, %3);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "QSocketNotifier: first argument (socket) must be an int.");
+ }
+}
+// @snippet qsocketnotifier
+
+// @snippet qtranslator-load
+Py_ssize_t size;
+uchar *ptr = reinterpret_cast<uchar*>(Shiboken::Buffer::getPointer(%PYARG_1, &size));
+%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(const_cast<const uchar*>(ptr), size);
+%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+// @snippet qtranslator-load
+
+// @snippet qtimer-singleshot-1
+// %FUNCTION_NAME() - disable generation of c++ function call
+(void) %2; // remove warning about unused variable
+Shiboken::AutoDecRef emptyTuple(PyTuple_New(0));
+PyObject *pyTimer = reinterpret_cast<PyTypeObject *>(Shiboken::SbkType<QTimer>())->tp_new(Shiboken::SbkType<QTimer>(), emptyTuple, 0);
+reinterpret_cast<PyTypeObject *>(Shiboken::SbkType<QTimer>())->tp_init(pyTimer, emptyTuple, 0);
+
+QTimer* timer = %CONVERTTOCPP[QTimer*](pyTimer);
+Shiboken::AutoDecRef result(
+ PyObject_CallMethod(pyTimer,
+ const_cast<char*>("connect"),
+ const_cast<char*>("OsOs"),
+ pyTimer,
+ SIGNAL(timeout()),
+ %PYARG_2,
+ %3)
+);
+Shiboken::Object::releaseOwnership((SbkObject*)pyTimer);
+Py_XDECREF(pyTimer);
+timer->setSingleShot(true);
+timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));
+timer->start(%1);
+// @snippet qtimer-singleshot-1
+
+// @snippet qtimer-singleshot-2
+// %FUNCTION_NAME() - disable generation of c++ function call
+Shiboken::AutoDecRef emptyTuple(PyTuple_New(0));
+PyObject *pyTimer = reinterpret_cast<PyTypeObject *>(Shiboken::SbkType<QTimer>())->tp_new(Shiboken::SbkType<QTimer>(), emptyTuple, 0);
+reinterpret_cast<PyTypeObject *>(Shiboken::SbkType<QTimer>())->tp_init(pyTimer, emptyTuple, 0);
+QTimer* timer = %CONVERTTOCPP[QTimer*](pyTimer);
+timer->setSingleShot(true);
+
+if (PyObject_TypeCheck(%2, PySideSignalInstanceTypeF())) {
+ PySideSignalInstance *signalInstance = reinterpret_cast<PySideSignalInstance*>(%2);
+ Shiboken::AutoDecRef signalSignature(Shiboken::String::fromFormat("2%s", PySide::Signal::getSignature(signalInstance)));
+ Shiboken::AutoDecRef result(
+ PyObject_CallMethod(pyTimer,
+ const_cast<char*>("connect"),
+ const_cast<char*>("OsOO"),
+ pyTimer,
+ SIGNAL(timeout()),
+ PySide::Signal::getObject(signalInstance),
+ signalSignature.object())
+ );
+} else {
+ Shiboken::AutoDecRef result(
+ PyObject_CallMethod(pyTimer,
+ const_cast<char*>("connect"),
+ const_cast<char*>("OsO"),
+ pyTimer,
+ SIGNAL(timeout()),
+ %PYARG_2)
+ );
+}
+
+timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()), Qt::DirectConnection);
+Shiboken::Object::releaseOwnership((SbkObject*)pyTimer);
+Py_XDECREF(pyTimer);
+timer->start(%1);
+// @snippet qtimer-singleshot-2
+
+// @snippet qprocess-startdetached
+qint64 pid;
+%RETURN_TYPE retval = %TYPE::%FUNCTION_NAME(%1, %2, %3, &pid);
+%PYARG_0 = PyTuple_New(2);
+PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval));
+PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[qint64](pid));
+// @snippet qprocess-startdetached
+
+// @snippet qprocess-pid
+long result;
+#ifdef WIN32
+ _PROCESS_INFORMATION *procInfo = %CPPSELF.%FUNCTION_NAME();
+ result = procInfo ? procInfo->dwProcessId : 0;
+#else
+ result = %CPPSELF.%FUNCTION_NAME();
+#endif
+%PYARG_0 = %CONVERTTOPYTHON[long](result);
+// @snippet qprocess-pid
+
+// @snippet qcoreapplication-1
+QCoreApplicationConstructor(%PYSELF, args, &%0);
+// @snippet qcoreapplication-1
+
+// @snippet qcoreapplication-2
+PyObject *empty = PyTuple_New(2);
+if (!PyTuple_SetItem(empty, 0, PyList_New(0))) {
+ QCoreApplicationConstructor(%PYSELF, empty, &%0);
+}
+// @snippet qcoreapplication-2
+
+// @snippet qcoreapplication-instance
+QCoreApplication *app = QCoreApplication::instance();
+PyObject *pyApp = Py_None;
+if (app) {
+ pyApp = reinterpret_cast<PyObject*>(
+ Shiboken::BindingManager::instance().retrieveWrapper(app));
+ if (!pyApp)
+ pyApp = %CONVERTTOPYTHON[QCoreApplication*](app);
+ // this will keep app live after python exit (extra ref)
+}
+// PYSIDE-571: make sure that we return the singleton "None"
+if (pyApp == Py_None)
+ Py_DECREF(MakeSingletonQAppWrapper(0)); // here qApp and instance() diverge
+%PYARG_0 = pyApp;
+Py_XINCREF(%PYARG_0);
+// @snippet qcoreapplication-instance
+
+// @snippet qdatastream-readrawdata
+QByteArray data;
+data.resize(%2);
+int result = %CPPSELF.%FUNCTION_NAME(data.data(), data.size());
+if (result == -1) {
+ Py_INCREF(Py_None);
+ %PYARG_0 = Py_None;
+} else {
+ %PYARG_0 = PyBytes_FromStringAndSize(data.data(), result);
+}
+// @snippet qdatastream-readrawdata
+
+// @snippet qdatastream-writerawdata
+int r = %CPPSELF.%FUNCTION_NAME(%1, Shiboken::String::len(%PYARG_1));
+%PYARG_0 = %CONVERTTOPYTHON[int](r);
+// @snippet qdatastream-writerawdata
+
+// @snippet releaseownership
+Shiboken::Object::releaseOwnership(%PYARG_0);
+// @snippet releaseownership
+
+// @snippet qanimationgroup-clear
+for (int counter = 0, count = %CPPSELF.animationCount(); counter < count; ++counter ) {
+ QAbstractAnimation *animation = %CPPSELF.animationAt(counter);
+ PyObject *obj = %CONVERTTOPYTHON[QAbstractAnimation*](animation);
+ Shiboken::Object::setParent(nullptr, obj);
+ Py_DECREF(obj);
+}
+%CPPSELF.clear();
+// @snippet qanimationgroup-clear
+
+// @snippet qeasingcurve
+PySideEasingCurveFunctor::init();
+// @snippet qeasingcurve
+
+// @snippet qeasingcurve-setcustomtype
+QEasingCurve::EasingFunction func = PySideEasingCurveFunctor::createCustomFuntion(%PYSELF, %PYARG_1);
+if (func)
+ %CPPSELF.%FUNCTION_NAME(func);
+// @snippet qeasingcurve-setcustomtype
+
+// @snippet qeasingcurve-customtype
+//%FUNCTION_NAME()
+%PYARG_0 = PySideEasingCurveFunctor::callable(%PYSELF);
+// @snippet qeasingcurve-customtype
+
+// @snippet qsignaltransition
+if (PyObject_TypeCheck(%1, PySideSignalInstanceTypeF())) {
+ PyObject *dataSource = PySide::Signal::getObject((PySideSignalInstance*)%PYARG_1);
+ Shiboken::AutoDecRef obType(PyObject_Type(dataSource));
+ QObject* sender = %CONVERTTOCPP[QObject*](dataSource);
+ if (sender) {
+ const char*dataSignature = PySide::Signal::getSignature((PySideSignalInstance*)%PYARG_1);
+ QByteArray signature(dataSignature); // Append SIGNAL flag (2)
+ signature.prepend('2');
+ %0 = new QSignalTransitionWrapper(sender, signature, %2);
+ }
+}
+// @snippet qsignaltransition
+
+// @snippet qstate-addtransition-1
+QString signalName(%2);
+if (PySide::SignalManager::registerMetaMethod(%1, signalName.mid(1).toLatin1().data(), QMetaMethod::Signal)) {
+ QSignalTransition *%0 = %CPPSELF->addTransition(%1, %2, %3);
+ %PYARG_0 = %CONVERTTOPYTHON[QSignalTransition*](%0);
+} else {
+ Py_INCREF(Py_None);
+ %PYARG_0 = Py_None;
+}
+// @snippet qstate-addtransition-1
+
+// @snippet qstate-addtransition-2
+// Obviously the label used by the following goto is a very awkward solution,
+// since it refers to a name very tied to the generator implementation.
+// Check bug #362 for more information on this
+// http://bugs.openbossa.org/show_bug.cgi?id=362
+if (!PyObject_TypeCheck(%1, PySideSignalInstanceTypeF()))
+ goto Sbk_%TYPEFunc_%FUNCTION_NAME_TypeError;
+PySideSignalInstance *signalInstance = reinterpret_cast<PySideSignalInstance*>(%1);
+QObject* sender = %CONVERTTOCPP[QObject*](PySide::Signal::getObject(signalInstance));
+QSignalTransition *%0 = %CPPSELF->%FUNCTION_NAME(sender, PySide::Signal::getSignature(signalInstance),%2);
+%PYARG_0 = %CONVERTTOPYTHON[QSignalTransition*](%0);
+// @snippet qstate-addtransition-2
+
+// @snippet qstatemachine-configuration
+%PYARG_0 = PySet_New(0);
+foreach (QAbstractState *abs_state, %CPPSELF.configuration()) {
+ Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractState*](abs_state));
+ Shiboken::Object::setParent(self, obj);
+ PySet_Add(%PYARG_0, obj);
+}
+// @snippet qstatemachine-configuration
+
+// @snippet qstatemachine-defaultanimations
+%PYARG_0 = PyList_New(0);
+foreach (QAbstractAnimation *abs_anim, %CPPSELF.defaultAnimations()) {
+ Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractAnimation*](abs_anim));
+ Shiboken::Object::setParent(self, obj);
+ PyList_Append(%PYARG_0, obj);
+}
+// @snippet qstatemachine-defaultanimations
+
+// @snippet qt-signal
+%PYARG_0 = Shiboken::String::fromFormat("2%s",QMetaObject::normalizedSignature(%1).constData());
+// @snippet qt-signal
+
+// @snippet qt-slot
+%PYARG_0 = Shiboken::String::fromFormat("1%s",QMetaObject::normalizedSignature(%1).constData());
+// @snippet qt-slot
+
+// @snippet qt-registerresourcedata
+QT_BEGIN_NAMESPACE
+extern bool
+qRegisterResourceData(int,
+ const unsigned char *,
+ const unsigned char *,
+ const unsigned char *);
+
+extern bool
+qUnregisterResourceData(int,
+ const unsigned char *,
+ const unsigned char *,
+ const unsigned char *);
+QT_END_NAMESPACE
+// @snippet qt-registerresourcedata
+
+// @snippet qt-qregisterresourcedata
+%RETURN_TYPE %0 = %FUNCTION_NAME(%1, reinterpret_cast<uchar*>(PyBytes_AS_STRING(%PYARG_2)),
+ reinterpret_cast<uchar*>(PyBytes_AS_STRING(%PYARG_3)),
+ reinterpret_cast<uchar*>(PyBytes_AS_STRING(%PYARG_4)));
+%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+// @snippet qt-qregisterresourcedata
+
+// @snippet qt-qunregisterresourcedata
+%RETURN_TYPE %0 = %FUNCTION_NAME(%1, reinterpret_cast<uchar*>(PyBytes_AS_STRING(%PYARG_2)),
+ reinterpret_cast<uchar*>(PyBytes_AS_STRING(%PYARG_3)),
+ reinterpret_cast<uchar*>(PyBytes_AS_STRING(%PYARG_4)));
+%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+// @snippet qt-qunregisterresourcedata
diff --git a/sources/pyside2/PySide2/glue/qtdatavisualization.cpp b/sources/pyside2/PySide2/glue/qtdatavisualization.cpp
new file mode 100644
index 000000000..119d79a40
--- /dev/null
+++ b/sources/pyside2/PySide2/glue/qtdatavisualization.cpp
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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$
+**
+****************************************************************************/
+
+// @snippet releaseownership
+Shiboken::Object::releaseOwnership(%PYARG_1);
+// @snippet releaseownership
diff --git a/sources/pyside2/PySide2/glue/qtgui.cpp b/sources/pyside2/PySide2/glue/qtgui.cpp
new file mode 100644
index 000000000..7f638e5cd
--- /dev/null
+++ b/sources/pyside2/PySide2/glue/qtgui.cpp
@@ -0,0 +1,494 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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$
+**
+****************************************************************************/
+
+// @snippet qtransform-quadtoquad
+QTransform _result;
+if (QTransform::quadToQuad(%1, %2, _result)) {
+ %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);
+} else {
+ Py_INCREF(Py_None);
+ %PYARG_0 = Py_None;
+}
+// @snippet qtransform-quadtoquad
+
+// @snippet qtransform-quadtosquare
+QTransform _result;
+if (QTransform::quadToSquare(%1, _result)) {
+ %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);
+} else {
+ Py_INCREF(Py_None);
+ %PYARG_0 = Py_None;
+}
+// @snippet qtransform-quadtosquare
+
+// @snippet qtransform-squaretoquad
+QTransform _result;
+if (QTransform::squareToQuad(%1, _result)) {
+ %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);
+} else {
+ Py_INCREF(Py_None);
+ %PYARG_0 = Py_None;
+}
+// @snippet qtransform-squaretoquad
+
+// @snippet qbitmap-fromdata
+uchar *buffer = reinterpret_cast<uchar*>(Shiboken::Buffer::getPointer(%PYARG_2));
+QBitmap %0 = QBitmap::fromData(%1, buffer, %3);
+%PYARG_0 = %CONVERTTOPYTHON[QBitmap](%0);
+// @snippet qbitmap-fromdata
+
+// @snippet qtextline-cursortox
+%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));
+// @snippet qtextline-cursortox
+
+// @snippet qkeysequence-getitem
+if (_i < 0 || _i >= %CPPSELF.count()) {
+ PyErr_SetString(PyExc_IndexError, "index out of bounds");
+ return 0;
+}
+int item = (*%CPPSELF)[_i];
+return %CONVERTTOPYTHON[int](item);
+// @snippet qkeysequence-getitem
+
+// @snippet qpicture-data
+%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.data(), %CPPSELF.size());
+// @snippet qpicture-data
+
+// @snippet qtextblock-setuserdata
+const QTextDocument *doc = %CPPSELF.document();
+if (doc) {
+ Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc));
+ Shiboken::Object::setParent(pyDocument, %PYARG_1);
+}
+// @snippet qtextblock-setuserdata
+
+// @snippet qtextblock-userdata
+const QTextDocument *doc = %CPPSELF.document();
+if (doc) {
+ Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc));
+ Shiboken::Object::setParent(pyDocument, %PYARG_0);
+}
+// @snippet qtextblock-userdata
+
+// @snippet qpolygon-reduce
+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));
+}
+// @snippet qpolygon-reduce
+
+// @snippet qpolygon-operatorlowerlower
+// %FUNCTION_NAME()
+*%CPPSELF << %1;
+%PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF);
+// @snippet qpolygon-operatorlowerlower
+
+// @snippet qpixmap
+%0 = new %TYPE(QPixmap::fromImage(%1));
+// @snippet qpixmap
+
+// @snippet qimage-constbits
+%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.byteCount());
+// @snippet qimage-constbits
+
+// @snippet qimage-bits
+// 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);
+// @snippet qimage-bits
+
+// @snippet qimage-constscanline
+%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1), %CPPSELF.bytesPerLine());
+// @snippet qimage-constscanline
+
+// @snippet qimage-scanline
+%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1), %CPPSELF.bytesPerLine(), Shiboken::Buffer::ReadWrite);
+// @snippet qimage-scanline
+
+// @snippet qcolor-setstate
+Shiboken::AutoDecRef func(PyObject_GetAttr(%PYSELF, PyTuple_GET_ITEM(%1, 0)));
+PyObject *args = PyTuple_GET_ITEM(%1, 1);
+%PYARG_0 = PyObject_Call(func, args, NULL);
+// @snippet qcolor-setstate
+
+// @snippet qcolor-reduce
+switch (%CPPSELF.spec()) {
+ case QColor::Rgb:
+ {
+ qreal r, g, b, a;
+ %CPPSELF.getRgbF(&r, &g, &b, &a);
+ %PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0),
+ "setRgbF", float(r), float(g), float(b), float(a));
+ break;
+ }
+ case QColor::Hsv:
+ {
+ qreal h, s, v, a;
+ %CPPSELF.getHsvF(&h, &s, &v, &a);
+ %PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0),
+ "setHsvF", float(h), float(s), float(v), float(a));
+ break;
+ }
+ case QColor::Cmyk:
+ {
+ qreal c, m, y, k, a;
+ %CPPSELF.getCmykF(&c, &m, &y, &k, &a);
+ %PYARG_0 = Py_BuildValue("(ON(s(fffff)))", Py_TYPE(%PYSELF), PyTuple_New(0),
+ "setCmykF", float(c), float(m), float(y), float(k), float(a));
+ break;
+ }
+ case QColor::Hsl:
+ {
+ qreal h, s, l, a;
+ %CPPSELF.getHslF(&h, &s, &l, &a);
+ %PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0),
+ "setHslF", float(h), float(s), float(l), float(a));
+ break;
+ }
+ default:
+ {
+ %PYARG_0 = Py_BuildValue("(N(O))", PyObject_Type(%PYSELF), Py_None);
+ }
+}
+// @snippet qcolor-reduce
+
+// @snippet qcolor-totuple
+switch (%CPPSELF.spec()) {
+ case QColor::Rgb:
+ {
+ int r, g, b, a;
+ %CPPSELF.getRgb(&r, &g, &b, &a);
+ %PYARG_0 = Py_BuildValue("iiii", r, g, b, a);
+ break;
+ }
+ case QColor::Hsv:
+ {
+ int h, s, v, a;
+ %CPPSELF.getHsv(&h, &s, &v, &a);
+ %PYARG_0 = Py_BuildValue("iiii", h, s, v, a);
+ break;
+ }
+ case QColor::Cmyk:
+ {
+ int c, m, y, k, a;
+ %CPPSELF.getCmyk(&c, &m, &y, &k, &a);
+ %PYARG_0 = Py_BuildValue("iiiii", c, m, y, k, a);
+ break;
+ }
+ case QColor::Hsl:
+ {
+ int h, s, l, a;
+ %CPPSELF.getHsl(&h, &s, &l, &a);
+ %PYARG_0 = Py_BuildValue("iiii", h, s, l, a);
+ break;
+ }
+ default:
+ {
+ %PYARG_0 = 0;
+ }
+}
+// @snippet qcolor-totuple
+
+// @snippet qcolor
+if (%1.type() == QVariant::Color)
+ %0 = new %TYPE(%1.value<QColor>());
+else
+ PyErr_SetString(PyExc_TypeError, "QVariant must be holding a QColor");
+// @snippet qcolor
+
+// @snippet qfontmetricsf-boundingrect
+int *array = nullptr;
+bool errorOccurred = false;
+
+if (numArgs == 5) {
+ array = Shiboken::sequenceToIntArray(%PYARG_5, true);
+ if (PyErr_Occurred()) {
+ delete [] array;
+ errorOccurred = true;
+ }
+}
+
+if (!errorOccurred) {
+ %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, array);
+
+ delete [] array;
+
+ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
+}
+// @snippet qfontmetricsf-boundingrect
+
+// @snippet qfontmetricsf-size
+int *array = nullptr;
+bool errorOccurred = false;
+
+if (numArgs == 4) {
+ array = Shiboken::sequenceToIntArray(%PYARG_4, true);
+ if (PyErr_Occurred()) {
+ delete [] array;
+ errorOccurred = true;
+ }
+}
+
+if (!errorOccurred) {
+ %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, array);
+
+ delete [] array;
+
+ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
+}
+// @snippet qfontmetricsf-size
+
+// @snippet qfontmetrics-boundingrect-1
+int *array = nullptr;
+bool errorOccurred = false;
+
+if (numArgs == 8) {
+ array = Shiboken::sequenceToIntArray(%PYARG_8, true);
+ if (PyErr_Occurred()) {
+ delete [] array;
+ errorOccurred = true;
+ }
+}
+
+if (!errorOccurred) {
+ %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, %6, %7, array);
+
+ delete [] array;
+
+ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
+}
+// @snippet qfontmetrics-boundingrect-1
+
+// @snippet qfontmetrics-boundingrect-2
+int *array = nullptr;
+bool errorOccurred = false;
+
+if (numArgs == 5) {
+ array = Shiboken::sequenceToIntArray(%PYARG_5, true);
+ if (PyErr_Occurred()) {
+ delete [] array;
+ errorOccurred = true;
+ }
+}
+
+if (!errorOccurred) {
+ %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, array);
+
+ delete [] array;
+
+ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
+}
+// @snippet qfontmetrics-boundingrect-2
+
+// @snippet qfontmetrics-size
+int *array = nullptr;
+bool errorOccurred = false;
+
+if (numArgs == 4) {
+ array = Shiboken::sequenceToIntArray(%PYARG_4, true);
+ if (PyErr_Occurred()) {
+ delete [] array;
+ errorOccurred = true;
+ }
+}
+
+if (!errorOccurred) {
+ %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, array);
+
+ delete [] array;
+
+ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
+}
+// @snippet qfontmetrics-size
+
+// @snippet qpixmapcache-find
+QPixmap p;
+if (%CPPSELF.%FUNCTION_NAME(%1, &p)) {
+ %PYARG_0 = %CONVERTTOPYTHON[QPixmap](p);
+} else {
+ %PYARG_0 = Py_None;
+ Py_INCREF(%PYARG_0);
+}
+// @snippet qpixmapcache-find
+
+// @snippet qstandarditem-setchild-1
+// Clear parent from the old child
+QStandardItem *_i = %CPPSELF->child(%1, %2);
+if (_i) {
+ PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ Shiboken::Object::setParent(nullptr, _pyI);
+}
+// @snippet qstandarditem-setchild-1
+
+// @snippet qstandarditem-setchild-2
+// Clear parent from the old child
+QStandardItem *_i = %CPPSELF->child(%1);
+if (_i) {
+ PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ Shiboken::Object::setParent(nullptr, _pyI);
+}
+// @snippet qstandarditem-setchild-2
+
+// @snippet qkeyevent-operatornotequal
+bool ret = !(&%CPPSELF == %1);
+%PYARG_0 = %CONVERTTOPYTHON[bool](ret);
+// @snippet qkeyevent-operatornotequal
+
+// @snippet qstandarditemmodel-setitem-1
+// Clear parent from the old child
+QStandardItem *_i = %CPPSELF->item(%1, %2);
+if (_i) {
+ PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ Shiboken::Object::setParent(nullptr, _pyI);
+}
+// @snippet qstandarditemmodel-setitem-1
+
+// @snippet qstandarditemmodel-setitem-2
+// Clear parent from the old child
+QStandardItem *_i = %CPPSELF->item(%1);
+if (_i) {
+ PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ Shiboken::Object::setParent(nullptr, _pyI);
+}
+// @snippet qstandarditemmodel-setitem-2
+
+// @snippet qstandarditemmodel-setverticalheaderitem
+// Clear parent from the old child
+QStandardItem *_i = %CPPSELF->verticalHeaderItem(%1);
+if (_i) {
+ PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ Shiboken::Object::setParent(nullptr, _pyI);
+}
+// @snippet qstandarditemmodel-setverticalheaderitem
+
+// @snippet qstandarditemmodel-clear
+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);
+}
+// @snippet qstandarditemmodel-clear
+
+// @snippet qclipboard-text
+%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));
+// @snippet qclipboard-text
+
+// @snippet qpainter-drawpolygon
+%BEGIN_ALLOW_THREADS
+%CPPSELF.%FUNCTION_NAME(%1.data(), %1.size(), %2);
+%END_ALLOW_THREADS
+// @snippet qpainter-drawpolygon
+
+// @snippet qmatrix4x4
+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]);
+}
+// @snippet qmatrix4x4
+
+// @snippet qmatrix4x4-copydatato
+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);
+}
+// @snippet qmatrix4x4-copydatato
+
+// @snippet qmatrix4x4-mgetitem
+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;
+// @snippet qmatrix4x4-mgetitem
+
+// @snippet qguiapplication-1
+QGuiApplicationConstructor(%PYSELF, args, &%0);
+// @snippet qguiapplication-1
+
+// @snippet qguiapplication-2
+PyObject *empty = PyTuple_New(2);
+if (!PyTuple_SetItem(empty, 0, PyList_New(0))) {
+ QGuiApplicationConstructor(%PYSELF, empty, &%0);
+}
+// @snippet qguiapplication-2
+
+// @snippet qtransform-quadtoquad
+// @snippet qtransform-quadtoquad
+
+// @snippet qtransform-quadtosquare
+// @snippet qtransform-quadtosquare
diff --git a/sources/pyside2/PySide2/glue/qtmultimedia.cpp b/sources/pyside2/PySide2/glue/qtmultimedia.cpp
new file mode 100644
index 000000000..520b5c4fa
--- /dev/null
+++ b/sources/pyside2/PySide2/glue/qtmultimedia.cpp
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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$
+**
+****************************************************************************/
+
+// @snippet upcast
+%BEGIN_ALLOW_THREADS
+QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1);
+%CPPSELF.%FUNCTION_NAME(reinterpret_cast< %ARG1_TYPE >(upcastedArg));
+%END_ALLOW_THREADS
+// @snippet upcast
diff --git a/sources/pyside2/PySide2/glue/qtnetwork.cpp b/sources/pyside2/PySide2/glue/qtnetwork.cpp
new file mode 100644
index 000000000..cdb330c40
--- /dev/null
+++ b/sources/pyside2/PySide2/glue/qtnetwork.cpp
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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$
+**
+****************************************************************************/
+
+// @snippet qudpsocket-readdatagram
+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));
+// @snippet qudpsocket-readdatagram
+
+// @snippet qipv6address-len
+return 16;
+// @snippet qipv6address-len
+
+// @snippet qipv6address-getitem
+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);
+// @snippet qipv6address-getitem
+
+// @snippet qipv6address-setitem
+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;
+// @snippet qipv6address-setitem
diff --git a/sources/pyside2/PySide2/glue/qtopengl.cpp b/sources/pyside2/PySide2/glue/qtopengl.cpp
new file mode 100644
index 000000000..6c106522c
--- /dev/null
+++ b/sources/pyside2/PySide2/glue/qtopengl.cpp
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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$
+**
+****************************************************************************/
+
+// @snippet qglbuffer-allocate
+int size = (%2 < 0) ? %1.size() : %2;
+%CPPSELF.allocate((const void*) %1.data(), size);
+// @snippet qglbuffer-allocate
+
+// @snippet qglbuffer-read
+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;
+// @snippet qglbuffer-read
+
+// @snippet qglbuffer-write
+int size = (%3 < 0) ? %2.size() : %3;
+%CPPSELF.write(%1, (const void*) %2.data(), size);
+// @snippet qglbuffer-write
+
+// @snippet qglbuffer-map
+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);
+}
+// @snippet qglbuffer-map
diff --git a/sources/pyside2/PySide2/glue/qtqml.cpp b/sources/pyside2/PySide2/glue/qtqml.cpp
new file mode 100644
index 000000000..1913204c3
--- /dev/null
+++ b/sources/pyside2/PySide2/glue/qtqml.cpp
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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$
+**
+****************************************************************************/
+
+// @snippet qmlregistertype
+int %0 = PySide::qmlRegisterType(%ARGUMENT_NAMES);
+%PYARG_0 = %CONVERTTOPYTHON[int](%0);
+// @snippet qmlregistertype
+
+// @snippet init
+PySide::initQmlSupport(module);
+// @snippet init
+
+// @snippet qjsengine-toscriptvalue
+%RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1);
+return %CONVERTTOPYTHON[%RETURN_TYPE](retval);
+// @snippet qjsengine-toscriptvalue
diff --git a/sources/pyside2/PySide2/glue/qtquick.cpp b/sources/pyside2/PySide2/glue/qtquick.cpp
new file mode 100644
index 000000000..b7c31aff3
--- /dev/null
+++ b/sources/pyside2/PySide2/glue/qtquick.cpp
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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$
+**
+****************************************************************************/
+
+// @snippet qtquick
+PySide::initQuickSupport(module);
+// @snippet qtquick
diff --git a/sources/pyside2/PySide2/glue/qtscript.cpp b/sources/pyside2/PySide2/glue/qtscript.cpp
new file mode 100644
index 000000000..7efc26f3e
--- /dev/null
+++ b/sources/pyside2/PySide2/glue/qtscript.cpp
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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$
+**
+****************************************************************************/
+
+// @snippet qscriptvalue-repr
+if (%CPPSELF.isVariant() || %CPPSELF.isString()) {
+ QString format = QString::asprintf("%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);
+}
+// @snippet qscriptvalue-repr
+
+// @snippet qscriptvalue-mgetitem
+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;
+}
+// @snippet qscriptvalue-mgetitem
+
+// @snippet qscriptvalueiterator-next
+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);
+}
+// @snippet qscriptvalueiterator-next
diff --git a/sources/pyside2/PySide2/glue/qtuitools.cpp b/sources/pyside2/PySide2/glue/qtuitools.cpp
new file mode 100644
index 000000000..0a2feb262
--- /dev/null
+++ b/sources/pyside2/PySide2/glue/qtuitools.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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$
+**
+****************************************************************************/
+
+// @snippet quiloader
+Q_IMPORT_PLUGIN(PyCustomWidgets);
+// @snippet quiloader
+
+// @snippet quiloader-registercustomwidget
+registerCustomWidget(%PYARG_1);
+%CPPSELF.addPluginPath(""); // force reload widgets
+// @snippet quiloader-registercustomwidget
+
+// @snippet quiloader-load-1
+// Avoid calling the original function: %CPPSELF.%FUNCTION_NAME()
+%PYARG_0 = QUiLoadedLoadUiFromDevice(%CPPSELF, %1, %2);
+// @snippet quiloader-load-1
+
+// @snippet quiloader-load-2
+// Avoid calling the original function: %CPPSELF.%FUNCTION_NAME()
+%PYARG_0 = QUiLoaderLoadUiFromFileName(%CPPSELF, %1, %2);
+// @snippet quiloader-load-2
diff --git a/sources/pyside2/PySide2/glue/qtwebkitwidgets.cpp b/sources/pyside2/PySide2/glue/qtwebkitwidgets.cpp
new file mode 100644
index 000000000..6744c4be2
--- /dev/null
+++ b/sources/pyside2/PySide2/glue/qtwebkitwidgets.cpp
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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$
+**
+****************************************************************************/
+
+// @snippet qwebview-page
+SbkObject* _pyReturn = reinterpret_cast<SbkObject*>(%PYARG_0);
+if (!Shiboken::Object::hasParentInfo(_pyReturn))
+ Shiboken::Object::setParent(%PYSELF, %PYARG_0);
+// @snippet qwebview-page
+
+// @snippet qwebelementcollection-len
+return %CPPSELF.count();
+// @snippet qwebelementcollection-len
+
+// @snippet qwebelementcollection-getitem
+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);
+// @snippet qwebelementcollection-getitem
+
+// @snippet qwebpage-qt-metacall
+static int _signalIndex = -1;
+static QMetaMethod _m;
+
+if (_signalIndex == -1) {
+ _signalIndex = QWebPage::staticMetaObject.indexOfSlot("shouldInterruptJavaScript()")
+ _m = QWebPage::staticMetaObject.method(_signalIndex);
+}
+
+if (_signalIndex == id) {
+ Shiboken::GilState gil;
+ PyObject* self = (PyObject*)Shiboken::BindingManager::instance().retrieveWrapper(this);
+
+ if (self) {
+ Shiboken::AutoDecRef _pyMethod(PyObject_GetAttrString(self, "shouldInterruptJavaScript"));
+ return PySide::SignalManager::callPythonMetaMethod(_m, args, _pyMethod, false);
+ }
+}
+// @snippet qwebpage-qt-metacall
diff --git a/sources/pyside2/PySide2/glue/qtwidgets.cpp b/sources/pyside2/PySide2/glue/qtwidgets.cpp
new file mode 100644
index 000000000..f0e446f62
--- /dev/null
+++ b/sources/pyside2/PySide2/glue/qtwidgets.cpp
@@ -0,0 +1,365 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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$
+**
+****************************************************************************/
+
+// @snippet qtreewidgetitemiterator-next
+if (**%CPPSELF) {
+ QTreeWidgetItemIterator *%0 = new QTreeWidgetItemIterator((*%CPPSELF)++);
+ %PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItemIterator*](%0);
+}
+// @snippet qtreewidgetitemiterator-next
+
+// @snippet qtreewidgetitemiterator-value
+QTreeWidgetItem *%0 = %CPPSELF.operator*();
+%PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItem*](%0);
+Shiboken::Object::releaseOwnership(%PYARG_0);
+// @snippet qtreewidgetitemiterator-value
+
+// @snippet qgraphicsitem
+PyObject *userTypeConstant = PyInt_FromLong(QGraphicsItem::UserType);
+PyDict_SetItemString(reinterpret_cast<PyTypeObject *>(Sbk_QGraphicsItem_TypeF())->tp_dict, "UserType", userTypeConstant);
+// @snippet qgraphicsitem
+
+// @snippet qgraphicsitem-scene-return-parenting
+if (%0) {
+ QObject *parent = %0->parent();
+ Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QObject*](parent));
+ Shiboken::Object::setParent(pyParent, %PYARG_0);
+}
+// @snippet qgraphicsitem-scene-return-parenting
+
+// @snippet qgraphicsitem-isblockedbymodalpanel
+QGraphicsItem *item_ = NULL;
+%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&item_);
+%PYARG_0 = PyTuple_New(2);
+PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
+PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QGraphicsItem*](item_));
+// @snippet qgraphicsitem-isblockedbymodalpanel
+
+// @snippet qitemeditorfactory-registereditor
+Shiboken::Object::releaseOwnership(%PYARG_2);
+// @snippet qitemeditorfactory-registereditor
+
+// @snippet qitemeditorfactory-setdefaultfactory
+//this function is static we need keep ref to default value, to be able to call python virtual functions
+static PyObject* _defaultValue = 0;
+%CPPSELF.%FUNCTION_NAME(%1);
+Py_INCREF(%PYARG_1);
+if (_defaultValue)
+ Py_DECREF(_defaultValue);
+
+_defaultValue = %PYARG_1;
+// @snippet qitemeditorfactory-setdefaultfactory
+
+// @snippet qmenu-addaction-1
+%PYARG_0 = addActionWithPyObject(%CPPSELF, QIcon(), %1, %2, %3);
+// @snippet qmenu-addaction-1
+
+// @snippet qmenu-addaction-2
+%PYARG_0 = addActionWithPyObject(%CPPSELF, %1, %2, %3, %4);
+// @snippet qmenu-addaction-2
+
+// @snippet qmenu-addaction-3
+%CPPSELF.addAction(%1);
+// @snippet qmenu-addaction-3
+
+// @snippet qmenu-clear
+Shiboken::BindingManager& bm = Shiboken::BindingManager::instance();
+const auto &actions = %CPPSELF.actions();
+for (QAction *act : actions) {
+ if (auto wrapper = bm.retrieveWrapper(act)) {
+ auto pyObj = reinterpret_cast<PyObject *>(wrapper);
+ Py_INCREF(pyObj);
+ Shiboken::Object::setParent(NULL, pyObj);
+ Shiboken::Object::invalidate(pyObj);
+ Py_DECREF(pyObj);
+ }
+}
+// @snippet qmenu-clear
+
+// @snippet qmenubar-clear
+const auto &actions = %CPPSELF.actions();
+for (QAction *act : actions) {
+ Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));
+ Shiboken::Object::setParent(NULL, pyAct);
+ Shiboken::Object::invalidate(pyAct);
+}
+// @snippet qmenubar-clear
+
+// @snippet qmenubar-addaction-1
+%PYARG_0 = addActionWithPyObject(%CPPSELF, %1, %2);
+// @snippet qmenubar-addaction-1
+
+// @snippet qmenubar-addaction-2
+%CPPSELF.addAction(%1);
+// @snippet qmenubar-addaction-2
+
+// @snippet qshortcut-1
+%0 = new %TYPE(%1, %2);
+// @snippet qshortcut-1
+
+// @snippet qshortcut-2
+Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF,
+ const_cast<char *>("connect"),
+ const_cast<char *>("OsO"),
+ %PYSELF, SIGNAL(activated()), %PYARG_3)
+);
+if (!result.isNull())
+ Shiboken::Object::setParent(%PYARG_2, %PYSELF);
+// @snippet qshortcut-2
+
+// @snippet qtoolbox-removeitem
+QWidget *_widget = %CPPSELF.widget(%1);
+if (_widget) {
+ Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](_widget));
+ Shiboken::Object::setParent(0, pyWidget);
+}
+// @snippet qtoolbox-removeitem
+
+// @snippet qlayout-setalignment
+%CPPSELF.setAlignment(%1);
+// @snippet qlayout-setalignment
+
+// @snippet addownership-0
+addLayoutOwnership(%CPPSELF, %0);
+// @snippet addownership-0
+
+// @snippet addownership-1
+addLayoutOwnership(%CPPSELF, %1);
+// @snippet addownership-1
+
+// @snippet addownership-2
+addLayoutOwnership(%CPPSELF, %2);
+// @snippet addownership-2
+
+// @snippet removeownership-1
+removeLayoutOwnership(%CPPSELF, %1);
+// @snippet removeownership-1
+
+// @snippet qgridlayout-getitemposition
+int a, b, c, d;
+%CPPSELF.%FUNCTION_NAME(%1, &a, &b, &c, &d);
+%PYARG_0 = PyTuple_New(4);
+PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](a));
+PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](b));
+PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](c));
+PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[int](d));
+// @snippet qgridlayout-getitemposition
+
+// @snippet qgraphicsscene-destroyitemgroup
+QGraphicsItem* parentItem = %1->parentItem();
+Shiboken::AutoDecRef parent(%CONVERTTOPYTHON[QGraphicsItem*](parentItem));
+const auto &childItems = %1->childItems();
+for (QGraphicsItem *item : childItems)
+ Shiboken::Object::setParent(parent, %CONVERTTOPYTHON[QGraphicsItem*](item));
+%BEGIN_ALLOW_THREADS
+%CPPSELF.%FUNCTION_NAME(%1);
+%END_ALLOW_THREADS
+// the arg was destroyed by Qt.
+Shiboken::Object::invalidate(%PYARG_1);
+// @snippet qgraphicsscene-destroyitemgroup
+
+// @snippet qgraphicsscene-addwidget
+%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2);
+%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+Shiboken::Object::keepReference((SbkObject*)%PYARG_0, "setWidget(QWidget*)1", %PYARG_1);
+// @snippet qgraphicsscene-addwidget
+
+// @snippet qgraphicsscene-clear
+const QList<QGraphicsItem*> items = %CPPSELF.items();
+Shiboken::BindingManager& bm = Shiboken::BindingManager::instance();
+for (QGraphicsItem *item : items) {
+ SbkObject* obj = bm.retrieveWrapper(item);
+ if (obj) {
+ if (reinterpret_cast<PyObject*>(obj)->ob_refcnt > 1) // If the refcnt is 1 the object will vannish anyway.
+ Shiboken::Object::invalidate(obj);
+ Shiboken::Object::removeParent(obj);
+ }
+}
+%CPPSELF.%FUNCTION_NAME();
+// @snippet qgraphicsscene-clear
+
+// @snippet qtreewidget-clear
+QTreeWidgetItem *rootItem = %CPPSELF.invisibleRootItem();
+Shiboken::BindingManager &bm = Shiboken::BindingManager::instance();
+for (int i = 0; i < rootItem->childCount(); ++i) {
+ QTreeWidgetItem *item = rootItem->child(i);
+ SbkObject* wrapper = bm.retrieveWrapper(item);
+ if (wrapper)
+ Shiboken::Object::setParent(0, reinterpret_cast<PyObject*>(wrapper));
+}
+// @snippet qtreewidget-clear
+
+// @snippet qtreewidgetitem
+// Only call the parent function if this return some value
+// the parent can be the TreeWidget
+if (%0)
+ Shiboken::Object::setParent(%PYARG_0, %PYSELF);
+// @snippet qtreewidgetitem
+
+// @snippet qlistwidget-clear
+Shiboken::BindingManager &bm = Shiboken::BindingManager::instance();
+for (int i = 0, count = %CPPSELF.count(); i < count; ++i) {
+ QListWidgetItem *item = %CPPSELF.item(i);
+ if (auto wrapper = bm.retrieveWrapper(item)) {
+ auto pyObj = reinterpret_cast<PyObject*>(wrapper);
+ Py_INCREF(pyObj);
+ Shiboken::Object::setParent(NULL, pyObj);
+ Shiboken::Object::invalidate(pyObj);
+ Py_DECREF(pyObj);
+ }
+}
+%CPPSELF.%FUNCTION_NAME();
+// @snippet qlistwidget-clear
+
+// @snippet qwidget-setstyle
+Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(%PYSELF), "__style__", %PYARG_1);
+// @snippet qwidget-setstyle
+
+// @snippet qwidget-style
+QStyle* myStyle = %CPPSELF->style();
+if (myStyle && qApp) {
+%PYARG_0 = %CONVERTTOPYTHON[QStyle*](myStyle);
+ QStyle *appStyle = qApp->style();
+ if (appStyle == myStyle) {
+ Shiboken::AutoDecRef pyApp(%CONVERTTOPYTHON[QApplication*](qApp));
+ Shiboken::Object::setParent(pyApp, %PYARG_0);
+ Shiboken::Object::releaseOwnership(%PYARG_0);
+ } else {
+ Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(%PYSELF), "__style__", %PYARG_0);
+ }
+}
+// @snippet qwidget-style
+
+// @snippet qwidget-setlayout
+qwidgetSetLayout(%CPPSELF, %1);
+// %FUNCTION_NAME() - disable generation of function call.
+// @snippet qwidget-setlayout
+
+// @snippet qtabwidget-removetab
+QWidget* tab = %CPPSELF.widget(%1);
+if (tab) {
+ Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](tab));
+ %CPPSELF.%FUNCTION_NAME(%1);
+}
+// @snippet qtabwidget-removetab
+
+// @snippet qtabwidget-clear
+Shiboken::BindingManager& bm = Shiboken::BindingManager::instance();
+for (int i = 0, count = %CPPSELF.count(); i < count; ++i) {
+ QWidget* widget = %CPPSELF.widget(i);
+ if (bm.hasWrapper(widget)) {
+ Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](widget));
+ Shiboken::Object::releaseOwnership(pyWidget);
+ }
+}
+%CPPSELF.%FUNCTION_NAME();
+// @snippet qtabwidget-clear
+
+// @snippet qlineedit-addaction
+%CPPSELF.addAction(%1);
+// @snippet qlineedit-addaction
+
+// @snippet qtoolbar-addaction-1
+QAction *action = %CPPSELF.addAction(%1, %2);
+%PYARG_0 = %CONVERTTOPYTHON[QAction*](action);
+Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0,
+ const_cast<char *>("connect"),
+ const_cast<char *>("OsO"),
+ %PYARG_0, SIGNAL(triggered()), %PYARG_3)
+);
+// @snippet qtoolbar-addaction-1
+
+// @snippet qtoolbar-addaction-2
+QAction *action = %CPPSELF.addAction(%1);
+%PYARG_0 = %CONVERTTOPYTHON[QAction*](action);
+Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0,
+ const_cast<char *>("connect"),
+ const_cast<char *>("OsO"),
+ %PYARG_0, SIGNAL(triggered()), %PYARG_2)
+);
+// @snippet qtoolbar-addaction-2
+
+// @snippet qtoolbar-addaction-3
+%CPPSELF.addAction(%1);
+// @snippet qtoolbar-addaction-3
+
+// @snippet qtoolbar-clear
+QList<PyObject* > lst;
+Shiboken::BindingManager& bm = Shiboken::BindingManager::instance();
+const auto &toolButtonChildren = %CPPSELF.findChildren<QToolButton*>();
+for (QToolButton *child : toolButtonChildren) {
+ if (bm.hasWrapper(child)) {
+ PyObject* pyChild = %CONVERTTOPYTHON[QToolButton*](child);
+ Shiboken::Object::setParent(0, pyChild);
+ lst << pyChild;
+ }
+}
+
+//Remove actions
+const auto &actions = %CPPSELF.actions();
+for (QAction *act : actions) {
+ Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));
+ Shiboken::Object::setParent(NULL, pyAct);
+ Shiboken::Object::invalidate(pyAct);
+}
+
+%CPPSELF.clear();
+for (PyObject *obj : lst) {
+ Shiboken::Object::invalidate(reinterpret_cast<SbkObject* >(obj));
+ Py_XDECREF(obj);
+}
+// @snippet qtoolbar-clear
+
+// @snippet qapplication-1
+QApplicationConstructor(%PYSELF, args, &%0);
+// @snippet qapplication-1
+
+// @snippet qapplication-2
+PyObject *empty = PyTuple_New(2);
+if (!PyTuple_SetItem(empty, 0, PyList_New(0)))
+ QApplicationConstructor(%PYSELF, empty, &%0);
+// @snippet qapplication-2
+
+// @snippet qgraphicsproxywidget-setwidget
+QWidget* _old = %CPPSELF.widget();
+if (_old)
+ Shiboken::Object::setParent(nullptr, %CONVERTTOPYTHON[QWidget*](_old));
+%CPPSELF.%FUNCTION_NAME(%1);
+Shiboken::Object::setParent(%PYSELF, %PYARG_1);
+// @snippet qgraphicsproxywidget-setwidget
diff --git a/sources/pyside2/PySide2/glue/qtxml.cpp b/sources/pyside2/PySide2/glue/qtxml.cpp
new file mode 100644
index 000000000..4c24c0c53
--- /dev/null
+++ b/sources/pyside2/PySide2/glue/qtxml.cpp
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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$
+**
+****************************************************************************/
+
+// @snippet qxmlentityresolver-resolveentity
+QXmlInputSource* _qxmlinputsource_arg_ = nullptr;
+%BEGIN_ALLOW_THREADS
+%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2, _qxmlinputsource_arg_);
+%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[QXmlInputSource*](_qxmlinputsource_arg_));
+// @snippet qxmlentityresolver-resolveentity
diff --git a/sources/pyside2/PySide2/glue/qtxmlpatterns.cpp b/sources/pyside2/PySide2/glue/qtxmlpatterns.cpp
new file mode 100644
index 000000000..b559ad1d4
--- /dev/null
+++ b/sources/pyside2/PySide2/glue/qtxmlpatterns.cpp
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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$
+**
+****************************************************************************/
+
+// @snippet qxmlschemavalidator-schema
+QXmlSchema* %0 = new QXmlSchema(%CPPSELF.schema());
+%PYARG_0 = %CONVERTTOPYTHON[QXmlSchema*](%0);
+// @snippet qxmlschemavalidator-schema