diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-01-04 09:41:34 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-01-04 12:26:11 +0100 |
commit | b96b672b208c6717c3362e08e42247912423fea1 (patch) | |
tree | 43b44110f6d7a2be6e12aa41a89f53c0fefc453c /sources/pyside6/libpyside/pyside.cpp | |
parent | 3bc23d37737184a89f780d84f431757cd7f725c2 (diff) |
PySide6: Port from QSharedPointer to std::shared_ptr
Task-number: QTBUG-109570
Change-Id: Ieb13bf352d9b75e364a73bddc464548ec19701ed
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/libpyside/pyside.cpp')
-rw-r--r-- | sources/pyside6/libpyside/pyside.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sources/pyside6/libpyside/pyside.cpp b/sources/pyside6/libpyside/pyside.cpp index b3d88e23b..50d125a28 100644 --- a/sources/pyside6/libpyside/pyside.cpp +++ b/sources/pyside6/libpyside/pyside.cpp @@ -38,13 +38,13 @@ #include <QtCore/QDir> #include <QtCore/QFileInfo> #include <QtCore/QMutex> -#include <QtCore/QSharedPointer> #include <QtCore/QStack> #include <QtCore/QThread> #include <algorithm> #include <cstring> #include <cctype> +#include <memory> #include <typeinfo> static QStack<PySide::CleanupFunction> cleanupFunctionList; @@ -632,11 +632,12 @@ void setNextQObjectMemoryAddr(void *addr) } // namespace PySide -// A QSharedPointer is used with a deletion function to invalidate a pointer +// A std::shared_ptr is used with a deletion function to invalidate a pointer // when the property value is cleared. This should be a QSharedPointer with // a void *pointer, but that isn't allowed typedef char any_t; -Q_DECLARE_METATYPE(QSharedPointer<any_t>); +Q_DECLARE_METATYPE(std::shared_ptr<any_t>); + namespace PySide { @@ -698,7 +699,7 @@ PyObject *getWrapperForQObject(QObject *cppSelf, PyTypeObject *sbk_type) QVariant existing = cppSelf->property(invalidatePropertyName); if (!existing.isValid()) { if (cppSelf->thread() == QThread::currentThread()) { - QSharedPointer<any_t> shared_with_del(reinterpret_cast<any_t *>(cppSelf), invalidatePtr); + std::shared_ptr<any_t> shared_with_del(reinterpret_cast<any_t *>(cppSelf), invalidatePtr); cppSelf->setProperty(invalidatePropertyName, QVariant::fromValue(shared_with_del)); } pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppSelf)); |