From cd67ab30927eed01ad3f068309033edca0478a3a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 19 Nov 2021 10:47:31 +0100 Subject: libpyside6: Use isEmpty() instead of empty() for Qt containers Pick-to: 6.2 Change-Id: I0e2f7164bd89ae75eb2aa1cb82adcfa317aea309 Reviewed-by: Christian Tismer --- sources/pyside6/libpyside/globalreceiverv2.cpp | 6 +++--- sources/pyside6/libpyside/pyside.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/pyside6/libpyside/globalreceiverv2.cpp b/sources/pyside6/libpyside/globalreceiverv2.cpp index 601e893f7..c935d1180 100644 --- a/sources/pyside6/libpyside/globalreceiverv2.cpp +++ b/sources/pyside6/libpyside/globalreceiverv2.cpp @@ -262,7 +262,7 @@ void GlobalReceiverV2::incRef(const QObject *link) void GlobalReceiverV2::decRef(const QObject *link) { - if (m_refs.empty()) + if (m_refs.isEmpty()) return; @@ -279,7 +279,7 @@ void GlobalReceiverV2::decRef(const QObject *link) } } - if (m_refs.empty()) + if (m_refs.isEmpty()) Py_BEGIN_ALLOW_THREADS delete this; Py_END_ALLOW_THREADS @@ -339,7 +339,7 @@ int GlobalReceiverV2::qt_metacall(QMetaObject::Call call, int id, void **args) } if (id == DESTROY_SLOT_ID) { - if (m_refs.empty()) + if (m_refs.isEmpty()) return -1; auto obj = *reinterpret_cast(args[1]); incRef(); //keep the object live (safe ref) diff --git a/sources/pyside6/libpyside/pyside.cpp b/sources/pyside6/libpyside/pyside.cpp index 51353afe2..cba7a4c38 100644 --- a/sources/pyside6/libpyside/pyside.cpp +++ b/sources/pyside6/libpyside/pyside.cpp @@ -360,7 +360,7 @@ PyObject *getMetaDataFromQObject(QObject *cppSelf, PyObject *self, PyObject *nam } } } - if (!signalList.empty()) { + if (!signalList.isEmpty()) { PyObject *pySignal = reinterpret_cast(Signal::newObjectFromMethod(self, signalList)); PyObject_SetAttr(self, name, pySignal); return pySignal; -- cgit v1.2.3