diff options
| author | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2021-04-06 22:16:57 +0200 |
|---|---|---|
| committer | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2021-05-04 15:24:45 +0200 |
| commit | 62acb997f7fce1ae922e3a9995272c78353048b9 (patch) | |
| tree | bc0eaef89232aebc83bf37152e5373e408020ffd /sources/pyside6/PySide6/glue/qtgui.cpp | |
| parent | d8bdd91bb6941f421d5fb0ac0ae20f10d43ff9ff (diff) | |
Enable the exec() functions
With Qt6, PySide dropped support for Python 2.7,
thus it does not make sense to keep our exec_() renaming inplace.
This patch will enable the exec() functions,
and adds a deprecation note for exec_(), which will enable us
to safely remove it in the future.
Change-Id: I7375e10632e7ab534ca264304a5a65f380b9b1bb
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/PySide6/glue/qtgui.cpp')
| -rw-r--r-- | sources/pyside6/PySide6/glue/qtgui.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/sources/pyside6/PySide6/glue/qtgui.cpp b/sources/pyside6/PySide6/glue/qtgui.cpp index 28d7c468e..48d246ddc 100644 --- a/sources/pyside6/PySide6/glue/qtgui.cpp +++ b/sources/pyside6/PySide6/glue/qtgui.cpp @@ -559,6 +559,51 @@ if (!result.isNull()) Shiboken::Object::setParent(%PYARG_2, %PYSELF); // @snippet qshortcut-2 +// @snippet qguiapplication-exec +if (PyErr_WarnEx(PyExc_DeprecationWarning, + "'exec_' will be removed in the future. " + "Use 'exec' instead.", + 1)) { + return nullptr; +} +%BEGIN_ALLOW_THREADS +int cppResult = %CPPSELF.exec(); +%END_ALLOW_THREADS +%PYARG_0 = %CONVERTTOPYTHON[int](cppResult); +// @snippet qguiapplication-exec + +// @snippet qdrag-exec-arg1 +if (PyErr_WarnEx(PyExc_DeprecationWarning, + "'exec_' will be removed in the future. " + "Use 'exec' instead.", + 1)) { + return nullptr; +} +%BEGIN_ALLOW_THREADS +int cppResult = %CPPSELF.exec(%1); +%END_ALLOW_THREADS +%PYARG_0 = %CONVERTTOPYTHON[int](cppResult); +// @snippet qdrag-exec-arg1 + +// @snippet qdrag-exec-arg2 +if (PyErr_WarnEx(PyExc_DeprecationWarning, + "'exec_' will be removed in the future. " + "Use 'exec' instead.", + 1)) { + return nullptr; +} +%BEGIN_ALLOW_THREADS +int cppResult; +if (numArgs == 2) + cppResult = %CPPSELF.exec(%1, %2); +else if (numArgs == 1) + cppResult = %CPPSELF.exec(%1); +else + cppResult = %CPPSELF.exec(); +%END_ALLOW_THREADS +%PYARG_0 = %CONVERTTOPYTHON[int](cppResult); +// @snippet qdrag-exec-arg2 + /********************************************************************* * CONVERSIONS ********************************************************************/ |
