Answers for "qt get hexa value from qstring"

C++
1

qt get hexa value from qstring

const QString str = QLatin1String("AA110011");
bool ok;
const unsigned int parsedValue = str.toUInt(&ok, 16); //16 because hex is base 16
if (!ok) {
    //Parsing failed, handle error here
}
Posted by: Guest on September-14-2021

Browse Popular Code Answers by Language