diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-19 23:12:16 +0100 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-19 23:12:16 +0100 |
| commit | 11b99fda8727f2225961c0b83ecdb18674a9670a (patch) | |
| tree | d835d8b677a294c59895537dbcd002cfd6678cfb /src | |
| parent | 09a5b9c25011b6976813130239994661ab1b0d66 (diff) | |
| download | BobinkQtOpcUa-11b99fda8727f2225961c0b83ecdb18674a9670a.tar.gz BobinkQtOpcUa-11b99fda8727f2225961c0b83ecdb18674a9670a.zip | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/BobinkClient.cpp | 23 | ||||
| -rw-r--r-- | src/BobinkClient.h | 1 |
2 files changed, 14 insertions, 10 deletions
diff --git a/src/BobinkClient.cpp b/src/BobinkClient.cpp index 7355a0c..41b7dbf 100644 --- a/src/BobinkClient.cpp +++ b/src/BobinkClient.cpp @@ -89,16 +89,7 @@ BobinkClient::setupClient () connect (m_client, &QOpcUaClient::findServersFinished, this, &BobinkClient::handleFindServersFinished); connect (m_client, &QOpcUaClient::errorChanged, this, - [this] (QOpcUaClient::ClientError error) - { - if (error == QOpcUaClient::NoError) - return; - auto me = QMetaEnum::fromType<QOpcUaClient::ClientError> (); - const char *key = me.valueToKey (static_cast<int> (error)); - emit connectionError ( - QStringLiteral ("Client error: %1") - .arg (key ? QLatin1StringView (key) : "Unknown"_L1)); - }); + &BobinkClient::handleClientError); } /* ====================================== @@ -332,6 +323,18 @@ BobinkClient::handleConnectError (QOpcUaErrorState *errorState) } } +void +BobinkClient::handleClientError (QOpcUaClient::ClientError error) +{ + if (error == QOpcUaClient::NoError) + return; + auto me = QMetaEnum::fromType<QOpcUaClient::ClientError> (); + const char *key = me.valueToKey (static_cast<int> (error)); + emit connectionError ( + QStringLiteral ("Client error: %1") + .arg (key ? QLatin1StringView (key) : "Unknown"_L1)); +} + /* ====================================== * Discovery * ====================================== */ diff --git a/src/BobinkClient.h b/src/BobinkClient.h index c566a67..7eb6c3c 100644 --- a/src/BobinkClient.h +++ b/src/BobinkClient.h @@ -155,6 +155,7 @@ private slots: QOpcUa::UaStatusCode statusCode, const QUrl &requestUrl); void handleConnectError (QOpcUaErrorState *errorState); + void handleClientError (QOpcUaClient::ClientError error); /* -- Discovery -- */ void handleFindServersFinished ( |
