1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

update sysinfo

This commit is contained in:
tianduanrui 2018-05-03 21:51:24 +08:00
parent 4b499190ba
commit 0a80706891
11 changed files with 97 additions and 63 deletions

View File

@ -0,0 +1,6 @@
#include "qqtsysteminfo.h"
QQtSystemInfo::QQtSystemInfo ( QObject* parent ) : QObject ( parent )
{
}

80
src/frame/qqtsysteminfo.h Normal file
View File

@ -0,0 +1,80 @@
#ifndef QQTSYSTEMINFO_H
#define QQTSYSTEMINFO_H
#include <QObject>
typedef struct tDiskInfo
{
tDiskInfo() {}
quint32 mSize; //B
quint32 mAvalableSize; //B
} TDiskInfo;
typedef struct tDiskTable
{
tDiskTable() {}
quint32 mNum;
QList<TDiskInfo> mList;
} TDiskTable;
typedef struct tMemInfo
{
tMemInfo() {}
} TMemInfo;
typedef struct tMemTable
{
tMemTable() {}
quint32 mTotalSize;//B
quint32 mAvalableSize;//B
quint32 mNum;
QList<TMemInfo> mList;
} TMemTable;
typedef struct tCPUInfo
{
tCPUInfo() {}
quint32 mCoreNum;
quint32 mThreadNumPerCore;
quint32 mRate;
} TCPUInfo;
typedef struct tCPUTable
{
tCPUTable() {}
quint32 mNum;
QList<TCPUInfo> mList;
} TCPUTable;
class QQtSystemInfo : public QObject
{
Q_OBJECT
public:
explicit QQtSystemInfo ( QObject* parent = nullptr );
bool getCPUInfo ( TCPUTable& cpuInfo ) {
#if 0
#if defined(Q_OS_WIN32) || defined (Q_OS_WIN64)
SYSTEM_INFO systemInfo;
GetSystemInfo ( &systemInfo );
qDebug() << QStringLiteral ( "处理器掩码:" ) << systemInfo.dwActiveProcessorMask;
qDebug() << QStringLiteral ( "处理器个数:" ) << systemInfo.dwNumberOfProcessors;
qDebug() << QStringLiteral ( "处理器分页大小:" ) << systemInfo.dwPageSize;
qDebug() << QStringLiteral ( "处理器类型:" ) << systemInfo.dwProcessorType;
qDebug() << QStringLiteral ( "最大寻址单元:" ) << systemInfo.lpMaximumApplicationAddress;
qDebug() << QStringLiteral ( "最小寻址单元:" ) << systemInfo.lpMinimumApplicationAddress;
qDebug() << QStringLiteral ( "处理器等级:" ) << systemInfo.wProcessorLevel;
qDebug() << QStringLiteral ( "处理器版本:" ) << systemInfo.wProcessorRevision;
#else
#endif
#endif
}
signals:
public slots:
private:
};
#endif // QQTSYSTEMINFO_H

View File

@ -1,6 +0,0 @@
#include "qqtsysteminfo.h"
QQtSystemInfo::QQtSystemInfo(QObject *parent) : QObject(parent)
{
}

View File

@ -1,23 +0,0 @@
#ifndef QQTSYSTEMINFO_H
#define QQTSYSTEMINFO_H
#include <QObject>
class QQtSystemInfoPrivate;
class QQtSystemInfo : public QObject
{
Q_OBJECT
public:
explicit QQtSystemInfo ( QObject* parent = nullptr );
signals:
public slots:
private:
Q_DECLARE_PRIVATE ( QQtSystemInfo )
Q_DISABLE_COPY ( QQtSystemInfo )
};
#endif // QQTSYSTEMINFO_H

View File

@ -1,6 +0,0 @@
#include "qqtsysteminfoprivate.h"
QQtSystemInfoPrivate::QQtSystemInfoPrivate(QObject *parent) : QObject(parent)
{
}

View File

@ -1,17 +0,0 @@
#ifndef QQTSYSTEMINFOPRIVATE_H
#define QQTSYSTEMINFOPRIVATE_H
#include <QObject>
class QQtSystemInfoPrivate : public QObject
{
Q_OBJECT
public:
explicit QQtSystemInfoPrivate(QObject *parent = nullptr);
signals:
public slots:
};
#endif // QQTSYSTEMINFOPRIVATE_H

0
src/linux_cd_path.sh Normal file → Executable file
View File

0
src/linux_cp_files.sh Normal file → Executable file
View File

0
src/linux_cur_path.sh Normal file → Executable file
View File

View File

@ -52,29 +52,30 @@ public:
*/
inline virtual quint16 splitter ( const QByteArray& ) { return 0; }
/**
* @brief
* @brief
* /.../quint16 size/.../QByteArray data/.../
* @param
* @return 0 no dispatched(others) 1 dispatched(own)
*/
inline virtual bool dispatcher ( const QByteArray& ) { return 0; }
/*
*
*/
signals:
/**
* @brief notifyToProtocolManager
* ProtocolManager添加的
* ProtocolManager添加的
*
* dispatcher的recv函数里
* emit notifyToProtocolManagerProtocolManager
* BusinessLevel对这些接收到的信息感兴趣
* ProtocolManager的notifyToBusinessLevel对拿到的信息进行处理使便
* PM的信号的连接PM内部自动管理了
* @param self
* @param message
*/
void notifyToProtocolManager ( const QQtProtocol* self, const QQtMessage* message );
/*
*
*/
/**
* Socket和这个Protocol关联
*/

View File

@ -14,12 +14,6 @@
#2018年4月6日18点12分
#这里是LibQQt源文件pri所有开关宏都在LibQQt头文件pri里开关。
#-------------------------------------------------
SOURCES = \
$$PWD/frame/systeminfo/qqtsysteminfo.cpp \
$$PWD/frame/systeminfo/qqtsysteminfoprivate.cpp
HEADERS = \
$$PWD/frame/systeminfo/qqtsysteminfo.h \
$$PWD/frame/systeminfo/qqtsysteminfoprivate.h
#root dir
HEADERS += $$PWD/qqt.h \
@ -146,6 +140,11 @@ FORMS += \
$$PWD/widgets/qqtprogressbar.ui
#frame
SOURCES += \
$$PWD/frame/qqtsysteminfo.cpp
HEADERS += \
$$PWD/frame/qqtsysteminfo.h
SOURCES += \
$$PWD/frame/qqtlineeditwithsearch.cpp \
$$PWD/frame/qqtosdwidget.cpp