Qt获取系统CPU信息

#include <QtCore/QCoreApplication>
#include <windows.h>
#include <qdebug.h>
using namespace std;
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    SYSTEM_INFO info;
    GetSystemInfo(&info);
    qDebug()<<"numbers of CPUs:"<<info.dwNumberOfProcessors;
    qDebug()<<"CPU type:"<<info.dwProcessorType;
    return a.exec();
}

你可能感兴趣的:(Qt获取系统CPU信息)