Qt获取系统CPU信息

来源:互联网 发布:18年网络教育改革 编辑:程序博客网 时间:2024/06/06 08:33
#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();}