aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/QtDataVisualization
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-08-31 14:27:02 +0200
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-11-28 16:11:36 +0000
commit0363a0986e19bfb97ed1b899fc1431a0e1b14dcb (patch)
tree9c5b67a91e61033b415f8d6b8d62c6ec86fd5dac /sources/pyside2/PySide2/QtDataVisualization
parentaddfdfb1ff195e36d412dc7aa3dde2f2d474c0ed (diff)
Place templates per module
There is a main template file that hosts most of the code-templates we use in the typesystems, but there were still several templates written in each module-typesystem file. The templates that are used on different typesystem are now placed in: sources/pyside2/PySide2/templates/core_common.xml Additionally, the templates used only by a certain module, are placed next to it, e.g.: sources/pyside2/PySide2/templates/widgets_common.xml Some simple templates were moved to the snippets files too. Task-number: PYSIDE-799 Change-Id: I4f355cf2ae983aba9e85414e910550189cd18dcb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'sources/pyside2/PySide2/QtDataVisualization')
-rw-r--r--sources/pyside2/PySide2/QtDataVisualization/typesystem_datavisualization.xml35
1 files changed, 2 insertions, 33 deletions
diff --git a/sources/pyside2/PySide2/QtDataVisualization/typesystem_datavisualization.xml b/sources/pyside2/PySide2/QtDataVisualization/typesystem_datavisualization.xml
index 2777f5519..94e6f4b88 100644
--- a/sources/pyside2/PySide2/QtDataVisualization/typesystem_datavisualization.xml
+++ b/sources/pyside2/PySide2/QtDataVisualization/typesystem_datavisualization.xml
@@ -41,39 +41,8 @@
-->
<typesystem package="PySide2.QtDataVisualization">
- <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>
- <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
+ <load-typesystem name="templates/datavisualization_common.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"/>