qt_demoe/control/devicesizetable/devicesizetable.h

97 lines
2.7 KiB
C
Raw Permalink Normal View History

2019-09-29 06:02:52 +00:00
#ifndef DEVICESIZETABLE_H
#define DEVICESIZETABLE_H
/**
* :feiyangqingyun(QQ:517216493) 2016-11-30
2021-09-13 08:12:35 +00:00
* 1. /
* 2.
* 3.
* 4. USD
2019-09-29 06:02:52 +00:00
*/
#include <QTableWidget>
class QProcess;
#ifdef quc
2020-12-24 10:00:09 +00:00
class Q_DECL_EXPORT DeviceSizeTable : public QTableWidget
2019-09-29 06:02:52 +00:00
#else
class DeviceSizeTable : public QTableWidget
#endif
{
Q_OBJECT
2021-05-30 07:59:42 +00:00
2019-09-29 06:02:52 +00:00
Q_PROPERTY(QColor bgColor READ getBgColor WRITE setBgColor)
Q_PROPERTY(QColor chunkColor1 READ getChunkColor1 WRITE setChunkColor1)
Q_PROPERTY(QColor chunkColor2 READ getChunkColor2 WRITE setChunkColor2)
Q_PROPERTY(QColor chunkColor3 READ getChunkColor3 WRITE setChunkColor3)
2023-09-08 05:51:39 +00:00
2019-09-29 06:02:52 +00:00
Q_PROPERTY(QColor textColor1 READ getTextColor1 WRITE setTextColor1)
Q_PROPERTY(QColor textColor2 READ getTextColor2 WRITE setTextColor2)
Q_PROPERTY(QColor textColor3 READ getTextColor3 WRITE setTextColor3)
public:
explicit DeviceSizeTable(QWidget *parent = 0);
private:
2023-09-08 05:51:39 +00:00
QProcess *process; //执行命令进程
QColor bgColor; //背景颜色
QColor chunkColor1; //进度颜色1
QColor chunkColor2; //进度颜色2
QColor chunkColor3; //进度颜色3
2019-09-29 06:02:52 +00:00
2023-09-08 05:51:39 +00:00
QColor textColor1; //文字颜色1
QColor textColor2; //文字颜色2
QColor textColor3; //文字颜色3
2019-09-29 06:02:52 +00:00
private slots:
void readData();
void checkSize(const QString &result, const QString &name);
void insertSize(const QString &name, const QString &use, const QString &free, const QString &all, int percent);
public:
2023-09-08 05:51:39 +00:00
//默认尺寸和最小尺寸
QSize sizeHint() const;
QSize minimumSizeHint() const;
2019-09-29 06:02:52 +00:00
2023-09-08 05:51:39 +00:00
//获取和设置背景颜色
QColor getBgColor() const;
2019-09-29 06:02:52 +00:00
void setBgColor(const QColor &bgColor);
2023-09-08 05:51:39 +00:00
//获取和设置进度颜色1
QColor getChunkColor1() const;
2019-09-29 06:02:52 +00:00
void setChunkColor1(const QColor &chunkColor1);
2023-09-08 05:51:39 +00:00
//获取和设置进度颜色2
QColor getChunkColor2() const;
2019-09-29 06:02:52 +00:00
void setChunkColor2(const QColor &chunkColor2);
2023-09-08 05:51:39 +00:00
//获取和设置进度颜色3
QColor getChunkColor3() const;
2019-09-29 06:02:52 +00:00
void setChunkColor3(const QColor &chunkColor3);
2023-09-08 05:51:39 +00:00
//获取和设置文字颜色1
QColor getTextColor1() const;
2019-09-29 06:02:52 +00:00
void setTextColor1(const QColor &textColor1);
2023-09-08 05:51:39 +00:00
//获取和设置文字颜色2
QColor getTextColor2() const;
2019-09-29 06:02:52 +00:00
void setTextColor2(const QColor &textColor2);
2023-09-08 05:51:39 +00:00
//获取和设置文字颜色3
QColor getTextColor3() const;
2019-09-29 06:02:52 +00:00
void setTextColor3(const QColor &textColor3);
2023-09-08 05:51:39 +00:00
public Q_SLOTS:
//载入容量
void load();
2019-09-29 06:02:52 +00:00
Q_SIGNALS:
void sdcardReceive(const QString &sdcardName);
void udiskReceive(const QString &udiskName);
};
#endif // DEVICESIZETABLE_H