diff options
Diffstat (limited to 'sources/pyside6')
| -rw-r--r-- | sources/pyside6/libpyside/pyside.cpp | 3 | ||||
| -rw-r--r-- | sources/pyside6/tests/pysidetest/qapp_like_a_macro_test.py | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sources/pyside6/libpyside/pyside.cpp b/sources/pyside6/libpyside/pyside.cpp index 75b3eb16f..22230703e 100644 --- a/sources/pyside6/libpyside/pyside.cpp +++ b/sources/pyside6/libpyside/pyside.cpp @@ -308,6 +308,9 @@ void initQApp() */ if (!qApp) Py_DECREF(MakeQAppWrapper(nullptr)); + + // PYSIDE-1470: Register a function to destroy an application from shiboken. + setDestroyQApplication(destroyQCoreApplication); } PyObject *getMetaDataFromQObject(QObject *cppSelf, PyObject *self, PyObject *name) diff --git a/sources/pyside6/tests/pysidetest/qapp_like_a_macro_test.py b/sources/pyside6/tests/pysidetest/qapp_like_a_macro_test.py index 2a796cea8..2233b1b33 100644 --- a/sources/pyside6/tests/pysidetest/qapp_like_a_macro_test.py +++ b/sources/pyside6/tests/pysidetest/qapp_like_a_macro_test.py @@ -59,10 +59,11 @@ class qAppMacroTest(unittest.TestCase): classes = (QtCore.QCoreApplication, QtGui.QGuiApplication, QtWidgets.QApplication) + fil = sys.stderr for klass in classes: - print("created", klass([])) + print("CREATED", klass([]), file=fil); fil.flush() qApp.shutdown() - print("deleted qApp", qApp) + print("DELETED qApp", qApp, file=fil); fil.flush() # creating without deletion raises: QtCore.QCoreApplication([]) with self.assertRaises(RuntimeError): |
