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/qtwidgets.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/qtwidgets.cpp')
| -rw-r--r-- | sources/pyside6/PySide6/glue/qtwidgets.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/sources/pyside6/PySide6/glue/qtwidgets.cpp b/sources/pyside6/PySide6/glue/qtwidgets.cpp index f41bc7616..bd431655e 100644 --- a/sources/pyside6/PySide6/glue/qtwidgets.cpp +++ b/sources/pyside6/PySide6/glue/qtwidgets.cpp @@ -632,6 +632,58 @@ if (_old) Shiboken::Object::setParent(%PYSELF, %PYARG_1); // @snippet qgraphicsproxywidget-setwidget +// @snippet qapplication-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 qapplication-exec + +// @snippet qmenu-exec-1 +if (PyErr_WarnEx(PyExc_DeprecationWarning, + "'exec_' will be removed in the future. " + "Use 'exec' instead.", + 1)) { + return nullptr; +} +%BEGIN_ALLOW_THREADS +QAction *cppResult = %CPPSELF.exec(); +%END_ALLOW_THREADS +%PYARG_0 = %CONVERTTOPYTHON[QAction](cppResult); +// @snippet qmenu-exec-1 + +// @snippet qmenu-exec-2 +if (PyErr_WarnEx(PyExc_DeprecationWarning, + "'exec_' will be removed in the future. " + "Use 'exec' instead.", + 1)) { + return nullptr; +} +%BEGIN_ALLOW_THREADS +QAction *cppResult = %CPPSELF.exec(%1, %2); +%END_ALLOW_THREADS +%PYARG_0 = %CONVERTTOPYTHON[QAction](cppResult); +// @snippet qmenu-exec-2 + +// @snippet qmenu-exec-3 +if (PyErr_WarnEx(PyExc_DeprecationWarning, + "'exec_' will be removed in the future. " + "Use 'exec' instead.", + 1)) { + return nullptr; +} +%BEGIN_ALLOW_THREADS +QAction *cppResult = %CPPSELF.exec(%1, %2, %3, %4); +%END_ALLOW_THREADS +%PYARG_0 = %CONVERTTOPYTHON[QAction*](cppResult); +// @snippet qmenu-exec-3 + /********************************************************************* * CONVERSIONS ********************************************************************/ |
