From f6155d62740a88b020273ba623c816f7b9805772 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Fri, 26 Nov 2021 13:44:39 +0100 Subject: Drop Q_GADGET from most uncopyable classes; other minor cleanup Q_GADGET is generally used to enable two things outside of QObject: Q_PROPERTY/Q_INVOKABLE and Q_ENUM/Q_FLAG. While the latter can be used in its own right in QML, the former requires Q_GADGET instances to be passed to QML by value, which is not really possible with uncopyable/unassignable classes. Bottom line is that Q_PROPERTY in anything derived from Quotient::Event is not viable, making Q_GADGET macro useless unless there's a Q_ENUM/Q_FLAG (as is the case with RoomMessageEvent, e.g.). --- lib/eventitem.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/eventitem.h') diff --git a/lib/eventitem.h b/lib/eventitem.h index a70a3c3e..0ab1a01d 100644 --- a/lib/eventitem.h +++ b/lib/eventitem.h @@ -9,7 +9,6 @@ #include namespace Quotient { -class StateEventBase; namespace EventStatus { Q_NAMESPACE @@ -31,8 +30,7 @@ namespace EventStatus { Replaced = 0x10, //< The event has been replaced Hidden = 0x100, //< The event should not be shown in the timeline }; - Q_DECLARE_FLAGS(Status, Code) - Q_FLAG_NS(Status) + Q_ENUM_NS(Code) } // namespace EventStatus class EventItemBase { @@ -106,7 +104,6 @@ inline const CallEventBase* EventItemBase::viewAs() const } class PendingEventItem : public EventItemBase { - Q_GADGET public: using EventItemBase::EventItemBase; -- cgit v1.2.3