diff options
-rw-r--r-- | src/RWAHost.cpp | 33 | ||||
-rw-r--r-- | src/RWAHost.h | 28 |
2 files changed, 32 insertions, 29 deletions
diff --git a/src/RWAHost.cpp b/src/RWAHost.cpp index 006ecd9..cc25b57 100644 --- a/src/RWAHost.cpp +++ b/src/RWAHost.cpp @@ -40,32 +40,29 @@ RWAHost::RWAHost(QString uuid, QString alias, QString url) { _uuid = uuid; } -QString RWAHost::url() const -{ - return _url; +QString RWAHost::uuid() const { + return _uuid; } -void RWAHost::setUrl(const QString &url) -{ - _url = url; +QString RWAHost::alias() const { + return _alias; } -QString RWAHost::alias() const -{ - return _alias; +QString RWAHost::url() const { + return _url; } -void RWAHost::setAlias(const QString &alias) -{ - _alias = alias; +void RWAHost::setUuid(const QString &uuid) { + _uuid = uuid; + emit uuidChanged(uuid); } -QString RWAHost::uuid() const -{ - return _uuid; +void RWAHost::setAlias(const QString &alias) { + _alias = alias; + emit aliasChanged(alias); } -void RWAHost::setUuid(const QString &uuid) -{ - _uuid = uuid; +void RWAHost::setUrl(const QString &url) { + _url = url; + emit urlChanged(url); } 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 <QObject> #include <QQuickItem> -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 |