diff options
Diffstat (limited to 'sources/pyside2/PySide2/glue')
-rw-r--r-- | sources/pyside2/PySide2/glue/qtcore.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sources/pyside2/PySide2/glue/qtcore.cpp b/sources/pyside2/PySide2/glue/qtcore.cpp index fde016548..9db4e2e82 100644 --- a/sources/pyside2/PySide2/glue/qtcore.cpp +++ b/sources/pyside2/PySide2/glue/qtcore.cpp @@ -1211,8 +1211,8 @@ QByteArray ba(1 + int(%2), char(0)); // @snippet qcryptographichash-adddata // @snippet qsocketnotifier -Shiboken::AutoDecRef socket(%PYARG_1); -if (!socket.isNull()) { +PyObject *socket = %PYARG_1; +if (socket != nullptr) { // We use qintptr as PyLong, but we check for int // since it is currently an alias to be Python2 compatible. // Internally, ints are qlonglongs. @@ -1340,18 +1340,17 @@ if (!PyTuple_SetItem(empty, 0, PyList_New(0))) { // @snippet qcoreapplication-2 // @snippet qcoreapplication-instance -QCoreApplication *app = QCoreApplication::instance(); PyObject *pyApp = Py_None; -if (app) { +if (qApp) { pyApp = reinterpret_cast<PyObject*>( - Shiboken::BindingManager::instance().retrieveWrapper(app)); + Shiboken::BindingManager::instance().retrieveWrapper(qApp)); if (!pyApp) - pyApp = %CONVERTTOPYTHON[QCoreApplication*](app); + pyApp = %CONVERTTOPYTHON[QCoreApplication*](qApp); // this will keep app live after python exit (extra ref) } // PYSIDE-571: make sure that we return the singleton "None" if (pyApp == Py_None) - Py_DECREF(MakeSingletonQAppWrapper(0)); // here qApp and instance() diverge + Py_DECREF(MakeSingletonQAppWrapper(nullptr)); // here qApp and instance() diverge %PYARG_0 = pyApp; Py_XINCREF(%PYARG_0); // @snippet qcoreapplication-instance |