diff options
Diffstat (limited to 'src/qml/qml/qqmlguard_p.h')
-rw-r--r-- | src/qml/qml/qqmlguard_p.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/qml/qml/qqmlguard_p.h b/src/qml/qml/qqmlguard_p.h index 3486b4f74f..685293868e 100644 --- a/src/qml/qml/qqmlguard_p.h +++ b/src/qml/qml/qqmlguard_p.h @@ -28,8 +28,10 @@ public: inline QQmlGuardImpl(); inline QQmlGuardImpl(QObject *); inline QQmlGuardImpl(const QQmlGuardImpl &); +protected: inline ~QQmlGuardImpl(); +public: // ### make so it can be private QObject *o = nullptr; QQmlGuardImpl *next = nullptr; QQmlGuardImpl **prev = nullptr; @@ -48,10 +50,10 @@ class QQmlGuard : protected QQmlGuardImpl { friend class QQmlData; public: - inline QQmlGuard(); - inline QQmlGuard(ObjectDestroyedFn objectDestroyed, T *); - inline QQmlGuard(T *); - inline QQmlGuard(const QQmlGuard<T> &); + Q_NODISCARD_CTOR inline QQmlGuard(); + Q_NODISCARD_CTOR inline QQmlGuard(ObjectDestroyedFn objectDestroyed, T *); + Q_NODISCARD_CTOR inline QQmlGuard(T *); + Q_NODISCARD_CTOR inline QQmlGuard(const QQmlGuard<T> &); inline QQmlGuard<T> &operator=(const QQmlGuard<T> &o); inline QQmlGuard<T> &operator=(T *); @@ -72,10 +74,10 @@ public: * We save it in objectDestroyFn to save space * (implemented in qqmlengine.cpp) */ -void Q_QML_PRIVATE_EXPORT hasJsOwnershipIndicator(QQmlGuardImpl *); +void Q_QML_EXPORT hasJsOwnershipIndicator(QQmlGuardImpl *); template <typename T> -class QQmlStrongJSQObjectReference : protected QQmlGuardImpl +class QQmlStrongJSQObjectReference final : protected QQmlGuardImpl { public: T *object() const noexcept { return static_cast<T *>(o); } |