Skip to content

Commit 4a8aa78

Browse files
committed
Register JoinRule
1 parent bd3eb35 commit 4a8aa78

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Quotient/quotient_common.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <qobjectdefs.h>
99
#include "util.h" // For Quotient::Literals::operator""_L1
10+
#include <QtQmlIntegration/qqmlintegration.h>
1011

1112
#include <array>
1213

@@ -133,6 +134,16 @@ enum JoinRule : uint16_t {
133134
};
134135
Q_ENUM_NS(JoinRule)
135136

137+
138+
struct JoinRuleQml
139+
{
140+
Q_GADGET
141+
QML_NAMED_ELEMENT(JoinRule)
142+
QML_UNCREATABLE("Only for enum values")
143+
QML_FOREIGN_NAMESPACE(Quotient)
144+
};
145+
146+
136147
} // namespace Quotient
137148
Q_DECLARE_OPERATORS_FOR_FLAGS(Quotient::MembershipMask)
138149
Q_DECLARE_OPERATORS_FOR_FLAGS(Quotient::JoinStates)

Quotient/room.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class QUOTIENT_API Room : public QObject {
170170
Q_PROPERTY(QStringList tagNames READ tagNames NOTIFY tagsChanged)
171171
Q_PROPERTY(bool isFavourite READ isFavourite NOTIFY tagsChanged STORED false)
172172
Q_PROPERTY(bool isLowPriority READ isLowPriority NOTIFY tagsChanged STORED false)
173-
Q_PROPERTY(JoinRule joinRule READ joinRule WRITE setJoinRule NOTIFY joinRuleChanged)
173+
Q_PROPERTY(Quotient::JoinRule joinRule READ joinRule WRITE setJoinRule NOTIFY joinRuleChanged)
174174
Q_PROPERTY(QList<QString> allowIds READ allowIds NOTIFY joinRuleChanged)
175175

176176
Q_PROPERTY(GetRoomEventsJob* eventsHistoryJob READ eventsHistoryJob NOTIFY eventsHistoryJobChanged)

0 commit comments

Comments
 (0)