-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinuxSysInfo.h
41 lines (33 loc) · 1 KB
/
LinuxSysInfo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef LINUXSYSINFO_H
#define LINUXSYSINFO_H
#include "ISystemInfoFactory.h"
#include <QObject>
class LinuxSysInfo : public ISystemInfoFactory
{
Q_OBJECT
typedef struct MEM_PACKED
{
char name{ 20 };
unsigned long total;
char unit_name{ 20 };
} MEM_OCCUPY;
public:
explicit LinuxSysInfo();
virtual ~LinuxSysInfo();
virtual QString cpuType(); //获取计算机CPU信息
virtual QString displayCard(); //获取计算机显卡信息
virtual QString memory(); //获取计算机内存
virtual QString osVersion(); //获取计算机操作系统
virtual QString screen(); //获取计算机屏幕个数以及像素
virtual QString disk(); //获取计算机硬盘信息
private:
QString m_osDescirbe;
QString m_cpuDescribe;
double m_totalMem;
double m_freeMem;
QString m_memDescribe;
QString m_diskDescribe;
QString m_cardDescribe;
double getValueByString(char *buff);
};
#endif // LINUXSYSINFO_H