From 905ebf6c895acfe04ef96f28ac72b303907f70a5 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 5 Apr 2017 18:46:50 +0300 Subject: Make Room data Q_PROPERTY's so that they could be accessed from QML too --- room.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/room.h b/room.h index 582b89c4..590ddb6d 100644 --- a/room.h +++ b/room.h @@ -64,6 +64,12 @@ namespace QMatrixClient { Q_OBJECT Q_PROPERTY(QString readMarkerEventId READ readMarkerEventId WRITE markMessagesAsRead NOTIFY readMarkerMoved) + Q_PROPERTY(QString id READ id CONSTANT) + Q_PROPERTY(QString name READ name NOTIFY namesChanged) + Q_PROPERTY(QStringList aliases READ aliases NOTIFY namesChanged) + Q_PROPERTY(QString canonicalAlias READ canonicalAlias NOTIFY namesChanged) + Q_PROPERTY(QString displayName READ displayName NOTIFY namesChanged) + Q_PROPERTY(QString topic READ topic NOTIFY topicChanged) public: using Timeline = std::deque; using rev_iter_t = Timeline::const_reverse_iterator; @@ -71,12 +77,12 @@ namespace QMatrixClient Room(Connection* connection, QString id); virtual ~Room(); - Q_INVOKABLE QString id() const; - Q_INVOKABLE QString name() const; - Q_INVOKABLE QStringList aliases() const; - Q_INVOKABLE QString canonicalAlias() const; - Q_INVOKABLE QString displayName() const; - Q_INVOKABLE QString topic() const; + QString id() const; + QString name() const; + QStringList aliases() const; + QString canonicalAlias() const; + QString displayName() const; + QString topic() const; Q_INVOKABLE JoinState joinState() const; Q_INVOKABLE QList usersTyping() const; QList membersLeft() const; -- cgit v1.2.3