aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/templates
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/PySide6/templates')
-rw-r--r--sources/pyside6/PySide6/templates/core_common.xml384
-rw-r--r--sources/pyside6/PySide6/templates/datavisualization_common.xml76
-rw-r--r--sources/pyside6/PySide6/templates/gui_common.xml307
-rw-r--r--sources/pyside6/PySide6/templates/opengl_common.xml61
-rw-r--r--sources/pyside6/PySide6/templates/openglfunctions_common.xml48
-rw-r--r--sources/pyside6/PySide6/templates/webkitwidgets_common.xml73
-rw-r--r--sources/pyside6/PySide6/templates/widgets_common.xml91
-rw-r--r--sources/pyside6/PySide6/templates/xml_common.xml58
8 files changed, 1098 insertions, 0 deletions
diff --git a/sources/pyside6/PySide6/templates/core_common.xml b/sources/pyside6/PySide6/templates/core_common.xml
new file mode 100644
index 000000000..a7c9eca3d
--- /dev/null
+++ b/sources/pyside6/PySide6/templates/core_common.xml
@@ -0,0 +1,384 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+-->
+<typesystem>
+
+ <template name="tuple_ok_retval">
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[bool](ok_));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
+ </template>
+
+ <template name="bool*_fix,arg">
+ bool ok_;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_, %2);
+ <insert-template name="tuple_ok_retval"/>
+ </template>
+
+ <template name="bool*_fix,arg,arg,arg,arg">
+ bool ok_;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_, %2, %3, %4, %5);
+ <insert-template name="tuple_ok_retval"/>
+ </template>
+
+ <!-- Templates to fix bool* parameters -->
+ <template name="tuple_retval_ok">
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[bool](ok_));
+ </template>
+
+ <template name="fix_bool*">
+ bool ok_;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_);
+ <insert-template name="tuple_retval_ok"/>
+ </template>
+
+ <template name="fix_args,bool*">
+ bool ok_;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;ok_);
+ <insert-template name="tuple_retval_ok"/>
+ </template>
+
+ <template name="fix_args,arg,bool*">
+ bool ok_;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, &amp;ok_);
+ <insert-template name="tuple_retval_ok"/>
+ </template>
+
+ <template name="fix_arg,bool*,arg">
+ bool ok_;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, &amp;ok_, %3);
+ <insert-template name="tuple_retval_ok"/>
+ </template>
+
+ <template name="fix_bool*,arg">
+ bool ok_;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_, %2);
+ <insert-template name="tuple_retval_ok"/>
+ </template>
+
+ <template name="fix_bool*,arg,arg">
+ bool ok_;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_, %2, %3);
+ <insert-template name="tuple_retval_ok"/>
+ </template>
+
+ <template name="fix_bool*,arg,arg,arg">
+ bool ok_;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_, %2, %3, %4);
+ <insert-template name="tuple_retval_ok"/>
+ </template>
+
+ <template name="fix_bool*,arg,arg,arg,arg">
+ bool ok_;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_, %2, %3, %4, %5);
+ <insert-template name="tuple_retval_ok"/>
+ </template>
+
+ <template name="fix_arg,arg,arg,arg,arg,arg,arg,bool*,arg">
+ bool ok_;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, %6, %7, &amp;ok_, %9);
+ <insert-template name="tuple_retval_ok"/>
+ </template>
+
+ <template name="fix_arg,arg,arg,arg,arg,arg,arg,bool*,arg,arg">
+ bool ok_;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, %6, %7, &amp;ok_, %9, %10);
+ <insert-template name="tuple_retval_ok"/>
+ </template>
+
+ <template name="fix_arg,arg,arg,arg,arg,arg,bool*,arg">
+ bool ok_;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, %6, &amp;ok_, %8);
+ <insert-template name="tuple_retval_ok"/>
+ </template>
+
+ <template name="fix_arg,arg,arg,arg,arg,bool*,arg">
+ bool ok_;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, &amp;ok_, %7);
+ <insert-template name="tuple_retval_ok"/>
+ </template>
+
+ <template name="fix_arg,arg,arg,arg,bool*,arg,arg">
+ bool ok_;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, &amp;ok_, %6, %7);
+ <insert-template name="tuple_retval_ok"/>
+ </template>
+
+ <template name="fix_char*">
+ char val_{};
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;val_);
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[char](val_));
+ </template>
+
+ <template name="tuple_abcd_same_type">
+ %PYARG_0 = PyTuple_New(4);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[$TYPE](a));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[$TYPE](b));
+ PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[$TYPE](c));
+ PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[$TYPE](d));
+ </template>
+
+ <template name="fix_number*,number*,number*,number*">
+ $TYPE a, b, c, d;
+ %CPPSELF->::%TYPE::%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d);
+ <insert-template name="tuple_abcd_same_type"/>
+ </template>
+
+ <template name="fix_number*,number*,number*,number*,args">
+ $TYPE a, b, c, d;
+ %CPPSELF->::%TYPE::%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d, %ARGUMENT_NAMES);
+ <insert-template name="tuple_abcd_same_type"/>
+ </template>
+
+ <template name="fix_native_return_number*,number*,number*,number*">
+ PyObject* _obj = %PYARG_0.object();
+ if (!PySequence_Check(_obj)
+ || PySequence_Fast_GET_SIZE(_obj) != 4
+ || !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 0))
+ || !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 1))
+ || !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 2))
+ || !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 3))) {
+ PyErr_SetString(PyExc_TypeError, "Sequence of 4 numbers expected");
+ } else {
+ *%1 = %CONVERTTOCPP[$TYPE](PySequence_Fast_GET_ITEM(_obj, 0));
+ *%2 = %CONVERTTOCPP[$TYPE](PySequence_Fast_GET_ITEM(_obj, 1));
+ *%3 = %CONVERTTOCPP[$TYPE](PySequence_Fast_GET_ITEM(_obj, 2));
+ *%4 = %CONVERTTOCPP[$TYPE](PySequence_Fast_GET_ITEM(_obj, 3));
+ }
+ </template>
+
+ <template name="fix_number*,number*,number*,number*,number*">
+ $TYPE a, b, c, d, e;
+ %CPPSELF.%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d, &amp;e);
+ %PYARG_0 = PyTuple_New(5);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[$TYPE](a));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[$TYPE](b));
+ PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[$TYPE](c));
+ PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[$TYPE](d));
+ PyTuple_SET_ITEM(%PYARG_0, 4, %CONVERTTOPYTHON[$TYPE](e));
+ </template>
+
+ <template name="fix_args,number*,number*">
+ $TYPE a, b;
+ %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;a, &amp;b);
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[$TYPE](a));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[$TYPE](b));
+ </template>
+
+ <template name="fix_arg,int*,int*">
+ %RETURN_TYPE _ret;
+ int a, b;
+ _ret = %CPPSELF.%FUNCTION_NAME(%1, &amp;a, &amp;b);
+ %PYARG_0 = PyTuple_New(3);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](_ret));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](a));
+ PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](b));
+ </template>
+
+ <template name="return_tuple_QValidator_QString_int">
+ %RETURN_TYPE retval_ = %RETURN_TYPE(%CPPSELF.%FUNCTION_NAME(%1, %2));
+ %PYARG_0 = PyTuple_New(3);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](%1));
+ PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[%ARG2_TYPE](%2));
+ </template>
+
+ <template name="repr_code">
+ QString format = QString::asprintf("%s(%REPR_FORMAT)",
+ Py_TYPE(%PYSELF)->tp_name, %REPR_ARGS);
+ %PYARG_0 = Shiboken::String::fromCString(qPrintable(format));
+ </template>
+
+ <template name="return_internal_pointer">
+ %PYARG_0 = reinterpret_cast&lt;PyObject*>(%CPPSELF.%FUNCTION_NAME());
+ if (!%PYARG_0)
+ %PYARG_0 = Py_None;
+ Py_INCREF(%PYARG_0);
+ </template>
+
+ <!-- Helpers for modifying "bool nativeEventFilter(QByteArray, void*, long *result)"
+ to return a tuple of bool,long -->
+ <template name="return_native_eventfilter_conversion_variables">
+ qintptr resultVar{0};
+ qintptr *%out = &amp;resultVar;
+ </template>
+ <template name="return_native_eventfilter_conversion">
+ %RETURN_TYPE %out = false;
+ if (PySequence_Check(%PYARG_0) &amp;&amp; (PySequence_Size(%PYARG_0) == 2)) {
+ Shiboken::AutoDecRef pyItem(PySequence_GetItem(%PYARG_0, 0));
+ %out = %CONVERTTOCPP[bool](pyItem);
+ if (result) {
+ Shiboken::AutoDecRef pyResultItem(PySequence_GetItem(pyResult, 1));
+ *result = %CONVERTTOCPP[long](pyResultItem);
+ }
+ }
+ </template>
+
+ <template name="return_native_eventfilter">
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[long](*result_out));
+ </template>
+
+ <!-- templates for __reduce__ -->
+ <template name="reduce_code">
+ %PYARG_0 = Py_BuildValue("(N(%REDUCE_FORMAT))", PyObject_Type(%PYSELF), %REDUCE_ARGS);
+ </template>
+
+ <!-- Replace '#' for the argument number you want. -->
+ <template name="return_argument">
+ Py_INCREF(%PYARG_#);
+ %PYARG_0 = %PYARG_#;
+ </template>
+
+ <!-- Iterator -->
+ <template name="__iter__">
+ Py_INCREF(%PYSELF);
+ %PYARG_0 = %PYSELF;
+ </template>
+
+ <template name="to_tuple">
+ %PYARG_0 = Py_BuildValue("%TT_FORMAT", %TT_ARGS);
+ </template>
+
+ <template name="cpplist_to_pylist_conversion">
+ PyObject* %out = PyList_New((int) %in.size());
+ %INTYPE::const_iterator it = %in.begin();
+ for (int idx = 0; it != %in.end(); ++it, ++idx) {
+ %INTYPE_0 cppItem(*it);
+ PyList_SET_ITEM(%out, idx, %CONVERTTOPYTHON[%INTYPE_0](cppItem));
+ }
+ return %out;
+ </template>
+
+ <template name="pyseq_to_cpplist_conversion">
+ // PYSIDE-795: Turn all sequences into iterables.
+ Shiboken::AutoDecRef it(PyObject_GetIter(%in));
+ PyObject *(*iternext)(PyObject *) = *Py_TYPE(it)->tp_iternext;
+ for (;;) {
+ Shiboken::AutoDecRef pyItem(iternext(it));
+ if (pyItem.isNull()) {
+ if (PyErr_Occurred() &amp;&amp; PyErr_ExceptionMatches(PyExc_StopIteration))
+ PyErr_Clear();
+ break;
+ }
+ %OUTTYPE_0 cppItem = %CONVERTTOCPP[%OUTTYPE_0](pyItem);
+ %out &lt;&lt; cppItem;
+ }
+ </template>
+
+ <template name="cppvector_to_pylist_conversion">
+ %INTYPE::size_type vectorSize = %in.size();
+ PyObject* %out = PyList_New((int) vectorSize);
+ for (%INTYPE::size_type idx = 0; idx &lt; vectorSize; ++idx) {
+ %INTYPE_0 cppItem(%in[idx]);
+ PyList_SET_ITEM(%out, idx, %CONVERTTOPYTHON[%INTYPE_0](cppItem));
+ }
+ return %out;
+ </template>
+
+ <template name="pyseq_to_cppvector_conversion">
+ // PYSIDE-795: Turn all sequences into iterables.
+ if (PySequence_Check(%in)) {
+ int vectorSize = PySequence_Size(%in);
+ %out.reserve(vectorSize);
+ }
+ Shiboken::AutoDecRef it(PyObject_GetIter(%in));
+ PyObject *(*iternext)(PyObject *) = *Py_TYPE(it)->tp_iternext;
+ for (;;) {
+ Shiboken::AutoDecRef pyItem(iternext(it));
+ if (pyItem.isNull()) {
+ if (PyErr_Occurred() &amp;&amp; PyErr_ExceptionMatches(PyExc_StopIteration))
+ PyErr_Clear();
+ break;
+ }
+ %OUTTYPE_0 cppItem = %CONVERTTOCPP[%OUTTYPE_0](pyItem);
+ %out.push_back(cppItem);
+ }
+ </template>
+
+ <template name="checkPyCapsuleOrPyCObject_func">
+ static bool checkPyCapsuleOrPyCObject(PyObject* pyObj)
+ {
+ return PyCapsule_CheckExact(pyObj);
+ }
+ </template>
+
+ <template name="cppmap_to_pymap_conversion">
+ PyObject *%out = PyDict_New();
+ for (%INTYPE::const_iterator it = %in.begin(), end = %in.end(); it != end; ++it) {
+ %INTYPE_0 key = it.key();
+ %INTYPE_1 value = it.value();
+ PyObject *pyKey = %CONVERTTOPYTHON[%INTYPE_0](key);
+ PyObject *pyValue = %CONVERTTOPYTHON[%INTYPE_1](value);
+ PyDict_SetItem(%out, pyKey, pyValue);
+ Py_DECREF(pyKey);
+ Py_DECREF(pyValue);
+ }
+ return %out;
+ </template>
+
+ <template name="pydict_to_cppmap_conversion">
+ PyObject *key;
+ PyObject *value;
+ Py_ssize_t pos = 0;
+ while (PyDict_Next(%in, &amp;pos, &amp;key, &amp;value)) {
+ %OUTTYPE_0 cppKey = %CONVERTTOCPP[%OUTTYPE_0](key);
+ %OUTTYPE_1 cppValue = %CONVERTTOCPP[%OUTTYPE_1](value);
+ %out.insert(cppKey, cppValue);
+ }
+ </template>
+
+ <template name="pydatetime_importandcheck_function">
+ static bool PyDateTime_ImportAndCheck(PyObject *pyIn)
+ {
+ if (!PyDateTimeAPI)
+ PyDateTime_IMPORT;
+ return $DATETIMETYPE_Check(pyIn);
+ }
+ </template>
+
+</typesystem>
diff --git a/sources/pyside6/PySide6/templates/datavisualization_common.xml b/sources/pyside6/PySide6/templates/datavisualization_common.xml
new file mode 100644
index 000000000..d5434dc75
--- /dev/null
+++ b/sources/pyside6/PySide6/templates/datavisualization_common.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+-->
+<typesystem>
+ <template name="cppqlistofptrtoqvectors_to_py_conversion">
+ const int rowCount = %in.size();
+ PyObject* %out = PyList_New(rowCount);
+ for (int r = 0; r &lt; rowCount; ++r) {
+ const QVector&lt;%INTYPE_0&gt; *row = %in.at(r);
+ const int columnCount = row->size();
+ PyObject *pyRow = PyList_New(columnCount);
+ for (int c = 0; c &lt; columnCount; ++c) {
+ const %INTYPE_0 &amp;cppItem = row->at(c);
+ PyList_SET_ITEM(pyRow, c, %CONVERTTOPYTHON[%INTYPE_0](cppItem));
+ }
+ PyList_SET_ITEM(%out, r, pyRow);
+ }
+ return %out;
+ </template>
+
+ <template name="py_to_cppqlistofptrtoqvectors_conversion">
+ const int rowCount = int(PySequence_Size(%in));
+ %OUTTYPE &amp;result = %out;
+ result.reserve(rowCount);
+ for (int r = 0; r &lt; rowCount; ++r) {
+ Shiboken::AutoDecRef rowItem(PySequence_GetItem(%in, r));
+ const int columnCount = int(PySequence_Size(rowItem));
+ QVector&lt;%OUTTYPE_0&gt; *row = new QVector&lt;%OUTTYPE_0&gt;;
+ row->reserve(columnCount);
+ for (int c = 0; c &lt; columnCount; ++c) {
+ Shiboken::AutoDecRef pyItem(PySequence_GetItem(rowItem, c));
+ %OUTTYPE_0 v = %CONVERTTOCPP[%OUTTYPE_0](pyItem);
+ row->append(v);
+ }
+ result.append(row);
+ }
+ </template>
+</typesystem>
diff --git a/sources/pyside6/PySide6/templates/gui_common.xml b/sources/pyside6/PySide6/templates/gui_common.xml
new file mode 100644
index 000000000..1869af8bb
--- /dev/null
+++ b/sources/pyside6/PySide6/templates/gui_common.xml
@@ -0,0 +1,307 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+-->
+<typesystem>
+ <template name="QFontCharFix">
+ int size = Shiboken::String::len(%PYARG_1);
+ if (size == 1) {
+ const char *str = Shiboken::String::toCString(%PYARG_1);
+ QChar ch(str[0]);
+ %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(ch);
+ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+ } else {
+ PyErr_SetString(PyExc_TypeError, "String must have only one character");
+ }
+ </template>
+
+ <template name="load_xpm">
+ Shiboken::AutoDecRef strList(PySequence_Fast(%PYARG_1, "Invalid sequence."));
+ int lineCount = PySequence_Fast_GET_SIZE(strList.object());
+ for (int line = 0; line &lt; lineCount; ++line) {
+ if (!Shiboken::String::check(PySequence_Fast_GET_ITEM(strList.object(), line))) {
+ PyErr_SetString(PyExc_TypeError, "The argument must be a sequence of strings.");
+ break;
+ }
+ }
+
+ const char **xpm = reinterpret_cast&lt;const char**&gt;(malloc(lineCount * sizeof(const char**)));
+ for (int line = 0; line &lt; lineCount; ++line)
+ xpm[line] = Shiboken::String::toCString(PySequence_Fast_GET_ITEM(strList.object(), line));
+
+ %0 = new %TYPE(xpm);
+
+ free(xpm);
+ </template>
+
+ <template name="qmatrix_map">
+ %ARG1_TYPE a, b;
+ %CPPSELF.%FUNCTION_NAME(%1, %2, &amp;a, &amp;b);
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%ARG1_TYPE](a));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](b));
+ </template>
+
+ <template name="qimage_buffer_constructor">
+ auto ptr = reinterpret_cast&lt;uchar*&gt;(Shiboken::Buffer::getPointer(%PYARG_1));
+ %0 = new %TYPE(ptr, %ARGS);
+ </template>
+
+ <template name="qcolor_repr">
+ switch(%CPPSELF.spec()) {
+ case QColor::Rgb:
+ {
+ float r, g, b, a;
+ %CPPSELF.getRgbF(&amp;r, &amp;g, &amp;b, &amp;a);
+ QString repr = QString::asprintf("PySide6.QtGui.QColor.fromRgbF(%.6f, %.6f, %.6f, %.6f)", r, g, b, a);
+ %PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
+ break;
+ }
+ case QColor::Hsv:
+ {
+ float h, s, v, a;
+ %CPPSELF.getHsvF(&amp;h, &amp;s, &amp;v, &amp;a);
+ QString repr = QString::asprintf("PySide6.QtGui.QColor.fromHsvF(%.6f, %.6f, %.6f, %.6f)", h, s, v, a);
+ %PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
+ break;
+ }
+ case QColor::Cmyk:
+ {
+ float c, m, y, k, a;
+ %CPPSELF.getCmykF(&amp;c, &amp;m, &amp;y, &amp;k, &amp;a);
+ QString repr = QString::asprintf("PySide6.QtGui.QColor.fromCmykF(%.6f, %.6f, %.6f, %.6f, %.6f)", c, m, y, k, a);
+ %PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
+ break;
+ }
+ case QColor::Hsl:
+ {
+ float h, s, l, a;
+ %CPPSELF.getHslF(&amp;h, &amp;s, &amp;l, &amp;a);
+ QString repr = QString::asprintf("PySide6.QtGui.QColor.fromHslF(%.6f, %.6f, %.6f, %.6f)", h, s, l, a);
+ %PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
+ break;
+ }
+ default:
+ {
+ %PYARG_0 = Shiboken::String::fromCString("PySide6.QtGui.QColor()");
+ }
+ }
+ </template>
+
+ <template name="qkeysequence_repr">
+ QString result;
+ QDebug debug(&amp;result);
+ debug.noquote();
+ debug.nospace();
+ debug &lt;&lt; (*%CPPSELF);
+ %PYARG_0 = Shiboken::String::fromCString(result.toUtf8().constData());
+ </template>
+
+ <template name="validator_conversionrule">
+ QValidator::State %out;
+
+ if (PySequence_Check(%PYARG_0)) {
+ Shiboken::AutoDecRef seq(PySequence_Fast(%PYARG_0, 0));
+ int size = PySequence_Fast_GET_SIZE(seq.object());
+
+ if (size > 1) {
+ if (%ISCONVERTIBLE[QString](PySequence_Fast_GET_ITEM(seq.object(), 1)))
+ %1 = %CONVERTTOCPP[QString](PySequence_Fast_GET_ITEM(seq.object(), 1));
+ else
+ qWarning("%TYPE::%FUNCTION_NAME: Second tuple element is not convertible to unicode.");
+ }
+
+ if (size > 2) {
+ if (%ISCONVERTIBLE[int](PySequence_Fast_GET_ITEM(seq.object(), 2)))
+ %2 = %CONVERTTOCPP[int](PySequence_Fast_GET_ITEM(seq.object(), 2));
+ else
+ qWarning("%TYPE::%FUNCTION_NAME: Second tuple element is not convertible to int.");
+ }
+ %PYARG_0.reset(PySequence_Fast_GET_ITEM(seq.object(), 0));
+ Py_INCREF(%PYARG_0); // we need to incref, because "%PYARG_0 = ..." will decref the tuple and the tuple will be decrefed again at the end of this scope.
+ }
+
+ // check retrun value
+ if (%ISCONVERTIBLE[QValidator::State](%PYARG_0)) {
+ %out = %CONVERTTOCPP[QValidator::State](%PYARG_0);
+ } else {
+ PyErr_Format(PyExc_TypeError, "Invalid return value in function %s, expected %s, got %s.",
+ "QValidator.validate",
+ "PySide6.QtGui.QValidator.State, (PySide6.QtGui.QValidator.State,), (PySide6.QtGui.QValidator.State, unicode) or (PySide6.QtGui.QValidator.State, unicode, int)",
+ Py_TYPE(pyResult)->tp_name);
+ return QValidator::State();
+ }
+ </template>
+
+ <template name="qpainter_drawlist">
+ %CPPSELF.%FUNCTION_NAME(%1.data(), %1.size());
+ </template>
+
+ <template name="inplace_add">
+ *%CPPSELF += %1;
+ return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);
+ </template>
+
+ <template name="inplace_sub">
+ *%CPPSELF -= %1;
+ return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);
+ </template>
+
+ <template name="inplace_mult">
+ *%CPPSELF *= %1;
+ return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);
+ </template>
+
+ <template name="inplace_div">
+ *%CPPSELF /= %1;
+ return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);
+ </template>
+
+ <template name="return_QString_native">
+ if (%ISCONVERTIBLE[QString](%PYARG_0))
+ %1 = %CONVERTTOCPP[QString](%PYARG_0);
+ else
+ qWarning("%TYPE::%FUNCTION_NAME: Argument is not convertible to unicode.");
+ </template>
+
+ <template name="repr_code_matrix">
+ QByteArray format(Py_TYPE(%PYSELF)->tp_name);
+ format += QByteArray("((");
+
+ QList&lt; %MATRIX_TYPE &gt; cppArgs;
+ %MATRIX_TYPE data[%MATRIX_SIZE];
+ %CPPSELF.copyDataTo(data);
+ int matrixSize = %MATRIX_SIZE;
+ for(int size=0; size &lt; matrixSize; size++) {
+ if (size > 0)
+ format += ", ";
+ format += QByteArray::number(data[size]);
+ }
+ format += "))";
+
+ %PYARG_0 = Shiboken::String::fromStringAndSize(format, format.size());
+ </template>
+
+ <template name="reduce_code_matrix">
+ QList&lt; %MATRIX_TYPE &gt; cppArgs;
+ %MATRIX_TYPE data[%MATRIX_SIZE];
+ %CPPSELF.copyDataTo(data);
+ int matrixSize = %MATRIX_SIZE;
+ for(int size=0; size &lt; matrixSize; size++)
+ cppArgs.append(data[size]);
+
+ PyObject *type = PyObject_Type(%PYSELF);
+ PyObject *args = Py_BuildValue("(N)",
+ %CONVERTTOPYTHON[QList&lt;%MATRIX_TYPE&gt; ](cppArgs));
+ %PYARG_0 = Py_BuildValue("(NN)", type, args);
+ </template>
+
+ <template name="matrix_data_function">
+ const float* data = %CPPSELF.constData();
+ PyObject *pyData = PyTuple_New(%MATRIX_SIZE);
+ if (data) {
+ for(int i=0; i &lt; %MATRIX_SIZE; i++)
+ PyTuple_SET_ITEM(pyData, i, %CONVERTTOPYTHON[float](data[i]));
+ }
+ return pyData;
+ </template>
+
+ <template name="matrix_constructor">
+ // PYSIDE-795: All PySequences can be made iterable with PySequence_Fast.
+ Shiboken::AutoDecRef seq(PySequence_Fast(%PYARG_1, "Can't turn into sequence"));
+ if (PySequence_Size(seq) == %SIZE) {
+ Shiboken::AutoDecRef fast(PySequence_Fast(seq,
+ "Failed to parse sequence on %TYPE constructor."));
+ float values[%SIZE];
+ for(int i=0; i &lt; %SIZE; i++) {
+ PyObject *pv = PySequence_Fast_GET_ITEM(fast.object(), i);
+ values[i] = %CONVERTTOCPP[float](pv);
+ }
+ %0 = new %TYPE(values);
+ }
+ </template>
+
+ <template name="fix_args,QRectF*">
+ QRectF rect_;
+ %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;rect_);
+ %PYARG_0 = %CONVERTTOPYTHON[QRectF](rect_);
+ </template>
+
+ <template name="fix_args,QRect*">
+ QRect rect_;
+ %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;rect_);
+ %PYARG_0 = %CONVERTTOPYTHON[QRect](rect_);
+ </template>
+
+ <template name="__next__">
+ if (!%CPPSELF.atEnd()) {
+ %PYARG_0 = %CONVERTTOPYTHON[%CPPSELF_TYPE](*%CPPSELF);
+ ++(*%CPPSELF);
+ }
+ </template>
+
+ <template name="__iter_parent__">
+ %CPPSELF_TYPE _tmp = %CPPSELF.begin();
+ %PYARG_0 = %CONVERTTOPYTHON[%CPPSELF_TYPE](_tmp);
+ </template>
+
+ <template name="const_char_pybuffer">
+ PyObject *%out = Shiboken::Buffer::newObject(%in, size);
+ </template>
+
+ <template name="pybuffer_const_char">
+ Py_ssize_t bufferLen;
+ char *%out = reinterpret_cast&lt;char*&gt;(Shiboken::Buffer::getPointer(%PYARG_1, &amp;bufferLen));
+ </template>
+
+ <template name="uint_remove">
+ uint %out = bufferLen;
+ </template>
+
+ <template name="pybytes_const_uchar">
+ const uchar *%out = reinterpret_cast&lt;const uchar*>(PyBytes_AS_STRING(%PYARG_1));
+ </template>
+
+ <template name="pybytes_uint">
+ uint %out = static_cast&lt;uint>(PyBytes_Size(%PYARG_1));
+ </template>
+
+
+</typesystem>
diff --git a/sources/pyside6/PySide6/templates/opengl_common.xml b/sources/pyside6/PySide6/templates/opengl_common.xml
new file mode 100644
index 000000000..ee7b021dd
--- /dev/null
+++ b/sources/pyside6/PySide6/templates/opengl_common.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+-->
+<typesystem>
+ <template name="callArrayFunction">
+ Py_ssize_t _size = PySequence_Size(%PYARG_2);
+ if (_size) {
+ $ATTR_TYPE *_list = new $ATTR_TYPE[_size];
+ if (_size) {
+ Shiboken::AutoDecRef fast(PySequence_Fast(%PYARG_2,
+ "Failed to parse sequence with type %VECTOR_TYPE."));
+ for(Py_ssize_t i=0; i &lt; _size; i++) {
+ PyObject* pv = PySequence_Fast_GET_ITEM(fast.object(), i);
+ _list[i] = %CONVERTTOCPP[$ATTR_TYPE](pv);
+ }
+ }
+ %CPPSELF.%FUNCTION_NAME(%1, _list, $ARG0);
+ delete[] _list;
+ } else {
+ %CPPSELF.%FUNCTION_NAME(%1, ($ATTR_TYPE*)nullptr, $ARG1);
+ }
+ </template>
+</typesystem>
diff --git a/sources/pyside6/PySide6/templates/openglfunctions_common.xml b/sources/pyside6/PySide6/templates/openglfunctions_common.xml
new file mode 100644
index 000000000..117229a29
--- /dev/null
+++ b/sources/pyside6/PySide6/templates/openglfunctions_common.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt for Python.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+-->
+<typesystem>
+ <template name="glGetString_return_QString">
+ const GLubyte *us = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES);
+ const QString s = QString::fromLocal8Bit(reinterpret_cast&lt;const char *&gt;(us));
+ %PYARG_0 = %CONVERTTOPYTHON[QString](s);
+ </template>
+</typesystem>
diff --git a/sources/pyside6/PySide6/templates/webkitwidgets_common.xml b/sources/pyside6/PySide6/templates/webkitwidgets_common.xml
new file mode 100644
index 000000000..9d0c8e587
--- /dev/null
+++ b/sources/pyside6/PySide6/templates/webkitwidgets_common.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+-->
+<typesystem>
+ <template name="qwebpage_extension_argument_conversion">
+ PyObject* %out = 0;
+ // Cast the parameters according to the extension type
+ if (extension == QWebPage::ChooseMultipleFilesExtension) {
+ const ChooseMultipleFilesExtension$TYPE_SUFFIX* _in = reinterpret_cast&lt;const ChooseMultipleFilesExtension$TYPE_SUFFIX*>(%in);
+ %out = %CONVERTTOPYTHON[const QWebPage::ChooseMultipleFilesExtension$TYPE_SUFFIX*](_in);
+ } else if (extension == QWebPage::ErrorPageExtension) {
+ const auto _in = reinterpret_cast&lt;const ErrorPageExtension$TYPE_SUFFIX*>(%in);
+ %out = %CONVERTTOPYTHON[const QWebPage::ErrorPageExtension$TYPE_SUFFIX*](_in);
+ }
+ </template>
+
+ <template name="qstring_remove">
+ QString _local;
+ QString* %4 = &amp;_local;
+ </template>
+
+ <template name="pysequence_qstring">
+ Shiboken::AutoDecRef pyRes(PySequence_GetItem(%PYARG_0, 0));
+ Shiboken::AutoDecRef pyStr(PySequence_GetItem(%PYARG_0, 1));
+ %RETURN_TYPE %out = %CONVERTTOCPP[%RETURN_TYPE](pyRes);
+ *%4 = %CONVERTTOCPP[QString](pyStr);
+ </template>
+
+ <template name="qstring_pytuple">
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QString](*%4));
+ </template>
+
+</typesystem>
diff --git a/sources/pyside6/PySide6/templates/widgets_common.xml b/sources/pyside6/PySide6/templates/widgets_common.xml
new file mode 100644
index 000000000..9ce01e79a
--- /dev/null
+++ b/sources/pyside6/PySide6/templates/widgets_common.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+-->
+<typesystem>
+
+ <template name="replace_child">
+ $CHILD_TYPE* oldChild = %CPPSELF.$FUNCTION_GET_OLD();
+ if (oldChild &amp;&amp; (oldChild != $CPPARG)) {
+ Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[$CHILD_TYPE*](oldChild));
+ Shiboken::Object::setParent(0, pyChild);
+ Shiboken::Object::releaseOwnership(pyChild);
+ }
+ Shiboken::Object::setParent(%PYSELF, $PYARG);
+ </template>
+
+ <template name="qgraphicsitem_pysequence">
+ int numItems = PySequence_Size(%PYARG_1);
+ Shiboken::AutoArrayPointer&lt;QGraphicsItem*&gt; %out(numItems);
+ for (int i=0; i &lt; numItems; i++) {
+ %out[i] = %CONVERTTOCPP[QGraphicsItem*](PySequence_Fast_GET_ITEM(%PYARG_1, i));
+ }
+ </template>
+
+ <template name="qgraphicsitem_pyobject">
+ Shiboken::AutoDecRef object(PyList_New(0));
+ for (int i=0, max=numItems; i &lt; max; i++) {
+ PyList_Append(object, %CONVERTTOPYTHON[QGraphicsItem*](%in[i]));
+ }
+ PyObject *%out = object.object();
+ </template>
+
+ <template name="qstyleoptiongraphicsitem_pyobject">
+ Shiboken::AutoDecRef option_object(PyList_New(0));
+ for (int i=0, max=numItems; i &lt; max; i++) {
+ const QStyleOptionGraphicsItem* item = &amp;%in[i];
+ PyList_Append(option_object, %CONVERTTOPYTHON[QStyleOptionGraphicsItem](item));
+ }
+ PyObject* %out = option_object.object();
+ </template>
+
+ <template name="pysequence_qstyleoptiongraphicsitem">
+ int numOptions = PySequence_Size(%PYARG_2);
+ Shiboken::AutoArrayPointer&lt;QStyleOptionGraphicsItem&gt; %out(numOptions);
+ for (int i=0; i &lt; numOptions; i++) {
+ %out[i] = %CONVERTTOCPP[QStyleOptionGraphicsItem](PySequence_Fast_GET_ITEM(%PYARG_1, i));
+ }
+ </template>
+
+ <template name="pysequencesize_int">
+ int %out = PySequence_Size(%PYARG_1);
+ </template>
+
+</typesystem>
diff --git a/sources/pyside6/PySide6/templates/xml_common.xml b/sources/pyside6/PySide6/templates/xml_common.xml
new file mode 100644
index 000000000..0a6ae4906
--- /dev/null
+++ b/sources/pyside6/PySide6/templates/xml_common.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+-->
+<typesystem>
+
+ <template name="QXmlEntityResolver_resolveEntity_return_conversion_native">
+ Shiboken::AutoDecRef _py_ok_(PySequence_GetItem(%PYARG_0, 0));
+ Shiboken::AutoDecRef _py_ret_(PySequence_GetItem(%PYARG_0, 1));
+ %RETURN_TYPE %out = %CONVERTTOCPP[%RETURN_TYPE](_py_ok_);
+ %3 = %CONVERTTOCPP[QXmlInputSource*](_py_ret_);
+ </template>
+
+ <template name="fix_virtual_method_return_value_and_bool*">
+ Shiboken::AutoDecRef _py_ret_(PySequence_GetItem(%PYARG_0, 0));
+ Shiboken::AutoDecRef _py_ok_(PySequence_GetItem(%PYARG_0, 1));
+ %RETURN_TYPE %out = %CONVERTTOCPP[%RETURN_TYPE](_py_ret_);
+ *%2 = %CONVERTTOCPP[bool](_py_ok_);
+ </template>
+
+</typesystem>