aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-04-05 18:46:50 +0300
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-04-05 18:46:50 +0300
commit905ebf6c895acfe04ef96f28ac72b303907f70a5 (patch)
tree101d2a3c117c86198c1f3dce3e7810b6c6f13882
parent6fdadc74c6f090689daad211159930b46a66026d (diff)
downloadlibquotient-905ebf6c895acfe04ef96f28ac72b303907f70a5.tar.gz
libquotient-905ebf6c895acfe04ef96f28ac72b303907f70a5.zip
Make Room data Q_PROPERTY's so that they could be accessed from QML too
-rw-r--r--room.h18
1 files 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<TimelineItem>;
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<User*> usersTyping() const;
QList<User*> membersLeft() const;