Dear Support,
I am fairly new to OPC UA and not very experienced in c++ either.
How can I convert a QString into a UaString and vice versa?
I tried stuff like
stringQt =(OpcUa_String)stringUa;
I'd really appreciate your help!
Typeconversion between QString and UaString
Moderator: uasdkcpp
-
- Full Member
- Posts: 6
- Joined: 18 Sep 2013, 15:45
- Support Team
- Hero Member
- Posts: 3072
- Joined: 18 Mar 2011, 15:09
Re: Typeconversion between QString and UaString
Hello,
The internal String representation of UaString is UTF-8, so the easiest way to convert from UaString to QString is:
This works also the other way round.
The internal String representation of UaString is UTF-8, so the easiest way to convert from UaString to QString is:
Code: Select all
UaString sDisplayName = ...; // string with some content e.g. from browse call
QString sFoo = QString::fromUtf8(sDisplayName.toUtf8());
-
- Full Member
- Posts: 6
- Joined: 18 Sep 2013, 15:45
Re: Typeconversion between QString and UaString
Thank you guys!