diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-10-30 17:15:54 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-10-31 15:32:25 +0000 |
commit | 8d58d0ea77c8dcd3bd8e22639ca9947be43bf540 (patch) | |
tree | 9193c38527a686ed639998182a3dc3ea8e743e23 | |
parent | a7bfc7ebb30dd45e4692ec38d8b9ede6372939f0 (diff) |
Fix QtCoAP quickmulticastclient example
- Fix the usage of QtCoap::Error enum. It has been replaced with a
scoped enum and some values have been changed, but the *.qml file
has not been updated.
- It seems like qml does not recognize signals with scoped enum
parameters, use int instead.
Change-Id: I50965b01f36268c820007da78c5772dc19c43f27
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r-- | examples/coap/quickmulticastclient/main.qml | 2 | ||||
-rw-r--r-- | examples/coap/quickmulticastclient/qmlcoapmulticastclient.cpp | 2 | ||||
-rw-r--r-- | examples/coap/quickmulticastclient/qmlcoapmulticastclient.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/examples/coap/quickmulticastclient/main.qml b/examples/coap/quickmulticastclient/main.qml index 85fc8dc..927e16f 100644 --- a/examples/coap/quickmulticastclient/main.qml +++ b/examples/coap/quickmulticastclient/main.qml @@ -72,7 +72,7 @@ Window { onDiscovered: addResource(resource) onFinished: { - statusLabel.text = (error === QtCoap.NoError) + statusLabel.text = (error === QtCoap.Error.Ok) ? qsTr("Finished resource discovery.") : qsTr("Resource discovery failed with error code: %1").arg(error) } diff --git a/examples/coap/quickmulticastclient/qmlcoapmulticastclient.cpp b/examples/coap/quickmulticastclient/qmlcoapmulticastclient.cpp index 7c868eb..af8c788 100644 --- a/examples/coap/quickmulticastclient/qmlcoapmulticastclient.cpp +++ b/examples/coap/quickmulticastclient/qmlcoapmulticastclient.cpp @@ -61,7 +61,7 @@ QmlCoapMulticastClient::QmlCoapMulticastClient(QObject *parent) connect(this, &QCoapClient::finished, this, [this](QCoapReply *reply) { if (reply) - emit finished(reply->errorReceived()); + emit finished(static_cast<int>(reply->errorReceived())); else qCWarning(lcCoapClient, "Something went wrong, received a null reply"); }); diff --git a/examples/coap/quickmulticastclient/qmlcoapmulticastclient.h b/examples/coap/quickmulticastclient/qmlcoapmulticastclient.h index 7770ade..ecb1415 100644 --- a/examples/coap/quickmulticastclient/qmlcoapmulticastclient.h +++ b/examples/coap/quickmulticastclient/qmlcoapmulticastclient.h @@ -82,7 +82,7 @@ public: Q_SIGNALS: void discovered(const QmlCoapResource &resource); - void finished(QtCoap::Error error); + void finished(int error); public slots: void onDiscovered(QCoapResourceDiscoveryReply *reply, const QVector<QCoapResource> &resources); |