I have a function to get the name of the computer as QString. While updating my program to Qt5 the function QString::fromAscii still doesn't exist anymore. How can I get it to QString?
QString AppConfig::GetMachinename()
{
char* buf = new char[512];
DWORD size;
int res;
QString machineName;
if ((res = GetComputerNameA(buf, &size)))
{
machineName = QString::fromAscii(buf, size);
}
else
machineName = "FALSE!";
return machineName;
}