From 11b99fda8727f2225961c0b83ecdb18674a9670a Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Thu, 19 Feb 2026 23:12:16 +0100 Subject: Extract errorChanged lambda into named handleClientError slot --- src/BobinkClient.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/BobinkClient.cpp') 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 (); - const char *key = me.valueToKey (static_cast (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 (); + const char *key = me.valueToKey (static_cast (error)); + emit connectionError ( + QStringLiteral ("Client error: %1") + .arg (key ? QLatin1StringView (key) : "Unknown"_L1)); +} + /* ====================================== * Discovery * ====================================== */ -- cgit v1.2.3