diff options
Diffstat (limited to 'src/BobinkClient.cpp')
| -rw-r--r-- | src/BobinkClient.cpp | 23 |
1 files changed, 13 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 * ====================================== */ |
