From 510c581db134ac3e25b5a849a39a754fd0dc8667 Mon Sep 17 00:00:00 2001 From: chris Date: Wed, 5 Jun 2024 21:41:48 -0400 Subject: [PATCH] starting experiments with exposing property types --- src/libtiled/propertytype.cpp | 6 ++++++ src/libtiled/propertytype.h | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/libtiled/propertytype.cpp b/src/libtiled/propertytype.cpp index 5200877d166..5d1db21ca84 100644 --- a/src/libtiled/propertytype.cpp +++ b/src/libtiled/propertytype.cpp @@ -650,4 +650,10 @@ QJsonArray PropertyTypes::toJson(const QString &path) const return propertyTypesJson; } +PropertyTypes::PropertyTypes(PropertyTypes &&other) +{ + other.swap(*this); +} } // namespace Tiled + +#include "moc_propertytype.cpp" diff --git a/src/libtiled/propertytype.h b/src/libtiled/propertytype.h index 99969713fa0..ff59781485e 100644 --- a/src/libtiled/propertytype.h +++ b/src/libtiled/propertytype.h @@ -59,8 +59,10 @@ class TILEDSHARED_EXPORT ExportValue /** * The base class for custom property types. */ -class TILEDSHARED_EXPORT PropertyType +class TILEDSHARED_EXPORT PropertyType : public QObject { + Q_OBJECT + public: enum Type { PT_Invalid, @@ -177,13 +179,14 @@ class TILEDSHARED_EXPORT ClassPropertyType final : public PropertyType /** * Container class for property types. */ -class TILEDSHARED_EXPORT PropertyTypes +class TILEDSHARED_EXPORT PropertyTypes : public QObject { + Q_OBJECT using Types = QVector; public: PropertyTypes() = default; - PropertyTypes(PropertyTypes&& other) = default; + PropertyTypes(PropertyTypes&& other); ~PropertyTypes(); PropertyTypes& operator=(PropertyTypes&& other) = default;