diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-19 10:55:11 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-19 10:56:21 +0200 |
commit | 14384c4436ae14016af50359ff9029cd939d2364 (patch) | |
tree | b4ed8445f936dfc79d78bfe774927291dbc43868 /sources/pyside2/PySide2 | |
parent | 6c65516ca994e4fa024222e8861c8cb6fad41e48 (diff) | |
parent | c0f118e4106b5d38cd828425b6533147f111cdd4 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I5aa8f69849db51c61d058b7f0197b883b7d2d4e2
Diffstat (limited to 'sources/pyside2/PySide2')
-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 |