aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/QtWidgets
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-05-07 14:08:09 +0200
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-05-15 09:55:58 +0000
commita1d13bfe47c5b2b7ca2c915dca0094c1f8448deb (patch)
treead31f7902fabf967d0ff36c0058869bba2b751be /sources/pyside2/PySide2/QtWidgets
parente27cde95bc353b2f34ba3ef86a62c38b7231b6a4 (diff)
Add default parameter to Q*Applications
When no arguments are passed, build an empty list and to start a QCoreApplication, QApplication and QGuiApplication. This is a small effort to include the idea of a default parameter from Python. Change-Id: Ieedc1e7ee17de996778aa2d0bddfb88c5ef208cf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside2/PySide2/QtWidgets')
-rw-r--r--sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml8
1 files changed, 8 insertions, 0 deletions
diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
index 52b1c41d5..b4a6c2453 100644
--- a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
+++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
@@ -3201,6 +3201,14 @@
QApplicationConstructor(%PYSELF, args, &amp;%0);
</inject-code>
</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>
+ </add-function>
<modify-function signature="exec()" rename="exec_" allow-thread="yes"/>
<inject-code class="native" file="glue/qapplication_init.cpp" position="beginning" />
</object-type>