aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltype_p_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-02-06 16:06:39 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-03-19 10:19:21 +0000
commit80920a3012239644ac0aba8c37a9a05e22e34b5a (patch)
treefb14f0868e3fad08db87af571ae5df4a1c711a43 /src/qml/qml/qqmltype_p_p.h
parent87af9e7396229907f712f50d803d8c16b0652efc (diff)
Use QQmlRefCount for QQmlType(Private)
As we already have an implementation of refcounting, we can just use that intead of inventing another one. This also gives us nice move ctors and operators. Also, use const pointers to QQmlTypePrivate where possible. This exposes quite some nastiness that needs to be fixed in follow-up commits: All the mutable members of QQmlTypePrivate are unsafe for multithreaded use. Change-Id: I3be8f2c53d86e06ffa80c8df8830473fe6d1d91d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmltype_p_p.h')
-rw-r--r--src/qml/qml/qqmltype_p_p.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/qml/qqmltype_p_p.h b/src/qml/qml/qqmltype_p_p.h
index 51984dd360..380139f385 100644
--- a/src/qml/qml/qqmltype_p_p.h
+++ b/src/qml/qml/qqmltype_p_p.h
@@ -59,19 +59,17 @@
QT_BEGIN_NAMESPACE
-class QQmlTypePrivate
+class QQmlTypePrivate : public QQmlRefCount
{
- Q_DISABLE_COPY(QQmlTypePrivate)
+ Q_DISABLE_COPY_MOVE(QQmlTypePrivate)
public:
QQmlTypePrivate(QQmlType::RegistrationType type);
- ~QQmlTypePrivate();
void init() const;
void initEnums(const QQmlPropertyCache *cache = nullptr) const;
void insertEnums(const QMetaObject *metaObject) const;
void insertEnumsFromPropertyCache(const QQmlPropertyCache *cache) const;
- QAtomicInt refCount;
QQmlType::RegistrationType regType;
struct QQmlCppTypeData
@@ -143,6 +141,8 @@ public:
void setName(const QString &uri, const QString &element);
private:
+ ~QQmlTypePrivate() override;
+
struct EnumInfo {
QStringList path;
QString metaObjectName;