aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/glue/qtwidgets.cpp
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/glue/qtwidgets.cpp
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/glue/qtwidgets.cpp')
-rw-r--r--sources/pyside2/PySide2/glue/qtwidgets.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/sources/pyside2/PySide2/glue/qtwidgets.cpp b/sources/pyside2/PySide2/glue/qtwidgets.cpp
index 02e74c997..2a8a8af0f 100644
--- a/sources/pyside2/PySide2/glue/qtwidgets.cpp
+++ b/sources/pyside2/PySide2/glue/qtwidgets.cpp
@@ -86,6 +86,26 @@ if (_defaultValue)
_defaultValue = %PYARG_1;
// @snippet qitemeditorfactory-setdefaultfactory
+// @snippet qformlayout-fix-args
+int _row;
+QFormLayout::ItemRole _role;
+%BEGIN_ALLOW_THREADS
+%CPPSELF->%FUNCTION_NAME(%ARGUMENT_NAMES, &_row, &_role);
+%END_ALLOW_THREADS
+%PYARG_0 = PyTuple_New(2);
+PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](_row));
+PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QFormLayout::ItemRole](_role));
+// @snippet qformlayout-fix-args
+
+// @snippet qfiledialog-return
+%BEGIN_ALLOW_THREADS
+%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, &%5, %6);
+%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[%ARG5_TYPE](%5));
+// @snippet qfiledialog-return
+
// @snippet qmenu-addaction-1
%PYARG_0 = addActionWithPyObject(%CPPSELF, QIcon(), %1, %2, %3);
// @snippet qmenu-addaction-1