bool Widget::IsSystem64()
{
SYSTEM_INFO si = { 0 };
GetNativeSystemInfo(&si);
if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 ||
si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64)
{
return true;
}else{
return false;
}
}
QString Widget::getOsName()
{
QOperatingSystemVersion winVer = QOperatingSystemVersion::current();
bool is64Bit = IsSystem64();
QString ver_suffix = is64Bit ? QStringLiteral("(64bit)") : QStringLiteral("(32bit)");
QString curOsName;
if( QOperatingSystemVersion::Windows7 <= winVer && QOperatingSystemVersion::Windows7 >= winVer){
curOsName = "Windows7" + ver_suffix;
}else if( QOperatingSystemVersion::Windows10 <= winVer && QOperatingSystemVersion::Windows10 >= winVer){
curOsName = "Windows10" + ver_suffix;
}
else{
curOsName = "None";
}
return curOsName;
}
|