From 9d3405f5e94e21e4401c30808dc3c93f6fbd3283 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Wed, 7 Jul 2021 15:40:58 +0200 Subject: RWAHost is now an QObject available to QML. --- src/RWAHost.h | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'src/RWAHost.h') diff --git a/src/RWAHost.h b/src/RWAHost.h index c78ef5f..58b6d45 100644 --- a/src/RWAHost.h +++ b/src/RWAHost.h @@ -29,19 +29,14 @@ #include #include -class RWAHost : public QObject -{ +class RWAHost : public QObject { Q_OBJECT -public: - explicit RWAHost(QString uuid = "", QString alias = "", QString url = ""); - - QString uuid() const; - QString alias() const; - QString url() const; + Q_PROPERTY(QString uuid READ uuid WRITE setUuid NOTIFY uuidChanged) + Q_PROPERTY(QString alias READ alias WRITE setAlias NOTIFY aliasChanged) + Q_PROPERTY(QString url READ url WRITE setUrl NOTIFY urlChanged) - void setUuid(const QString &uuid); - void setAlias(const QString &alias); - void setUrl(const QString &url); +public: + RWAHost(QString uuid = "", QString alias = "", QString url = ""); private: QString _uuid; @@ -49,8 +44,19 @@ private: QString _url; signals: + void uuidChanged(QString uuid); + void aliasChanged(QString alias); + void urlChanged(QString url); public slots: + QString uuid() const; + QString alias() const; + QString url() const; + + void setUuid(const QString &uuid); + void setAlias(const QString &alias); + void setUrl(const QString &url); + }; #endif // RWAHOST_H -- cgit v1.2.3