qlonglong wtfIsThis std string QString str QString fromStdString str s

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
qlonglong
wtfIsThis(std::string a)
{
QString str = QString::fromStdString(a);
str = str.left(16); // 000000003C3C88400000000000000000 -> 000000003C3C8840
str = Utils::dropLeadingZeroz(str); // 000000003C3C8840 -> 3C3C8840
bool ok;
qlonglong res = str.toLongLong(&ok, 16);
return ok ? res : -1;
}