diff options
author | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-05-07 14:08:09 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-05-15 09:55:58 +0000 |
commit | a1d13bfe47c5b2b7ca2c915dca0094c1f8448deb (patch) | |
tree | ad31f7902fabf967d0ff36c0058869bba2b751be /sources/pyside2/PySide2/QtGui | |
parent | e27cde95bc353b2f34ba3ef86a62c38b7231b6a4 (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/QtGui')
-rw-r--r-- | sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml index a9815cf67..6d69f6b4c 100644 --- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml +++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml @@ -3286,6 +3286,14 @@ QGuiApplicationConstructor(%PYSELF, args, &%0); </inject-code> </add-function> + <add-function signature="QGuiApplication()"> + <inject-code> + PyObject *empty = PyTuple_New(2); + if (!PyTuple_SetItem(empty, 0, PyList_New(0))) { + QGuiApplicationConstructor(%PYSELF, empty, &%0); + } + </inject-code> + </add-function> <modify-function signature="exec()" rename="exec_" allow-thread="yes"/> <inject-code class="native" file="glue/qguiapplication_init.cpp" position="beginning" /> |