diff options
author | Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de> | 2021-07-07 15:40:58 +0200 |
---|---|---|
committer | Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de> | 2021-07-07 15:40:58 +0200 |
commit | 9d3405f5e94e21e4401c30808dc3c93f6fbd3283 (patch) | |
tree | 483c6d1517c2a6c2f6003e194edf54dc49091fca /src | |
parent | 54249d9c37ce3994b03123ee6367c7f5519d3b40 (diff) | |
download | RWA.Support.DesktopApp-9d3405f5e94e21e4401c30808dc3c93f6fbd3283.tar.gz RWA.Support.DesktopApp-9d3405f5e94e21e4401c30808dc3c93f6fbd3283.tar.bz2 RWA.Support.DesktopApp-9d3405f5e94e21e4401c30808dc3c93f6fbd3283.zip |
RWAHost is now an QObject available to QML.
Diffstat (limited to 'src')
-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 |