更新文档

master
feiyangqingyun 2023-09-08 13:51:39 +08:00
parent 997f367a19
commit f9eae763ba
41 changed files with 1556 additions and 1464 deletions

View File

@ -144,86 +144,6 @@ void Battery::updateValue()
this->update();
}
double Battery::getMinValue() const
{
return this->minValue;
}
double Battery::getMaxValue() const
{
return this->maxValue;
}
double Battery::getValue() const
{
return this->value;
}
double Battery::getAlarmValue() const
{
return this->alarmValue;
}
bool Battery::getAnimation() const
{
return this->animation;
}
double Battery::getAnimationStep() const
{
return this->animationStep;
}
int Battery::getBorderWidth() const
{
return this->borderWidth;
}
int Battery::getBorderRadius() const
{
return this->borderRadius;
}
int Battery::getBgRadius() const
{
return this->bgRadius;
}
int Battery::getHeadRadius() const
{
return this->headRadius;
}
QColor Battery::getBorderColorStart() const
{
return this->borderColorStart;
}
QColor Battery::getBorderColorEnd() const
{
return this->borderColorEnd;
}
QColor Battery::getAlarmColorStart() const
{
return this->alarmColorStart;
}
QColor Battery::getAlarmColorEnd() const
{
return this->alarmColorEnd;
}
QColor Battery::getNormalColorStart() const
{
return this->normalColorStart;
}
QColor Battery::getNormalColorEnd() const
{
return this->normalColorEnd;
}
QSize Battery::sizeHint() const
{
return QSize(150, 80);
@ -260,16 +180,31 @@ void Battery::setRange(int minValue, int maxValue)
setRange((double)minValue, (double)maxValue);
}
double Battery::getMinValue() const
{
return this->minValue;
}
void Battery::setMinValue(double minValue)
{
setRange(minValue, maxValue);
}
double Battery::getMaxValue() const
{
return this->maxValue;
}
void Battery::setMaxValue(double maxValue)
{
setRange(minValue, maxValue);
}
double Battery::getValue() const
{
return this->value;
}
void Battery::setValue(double value)
{
//值和当前值一致则无需处理
@ -310,6 +245,11 @@ void Battery::setValue(int value)
setValue((double)value);
}
double Battery::getAlarmValue() const
{
return this->alarmValue;
}
void Battery::setAlarmValue(double alarmValue)
{
if (this->alarmValue != alarmValue) {
@ -323,6 +263,12 @@ void Battery::setAlarmValue(int alarmValue)
setAlarmValue((double)alarmValue);
}
bool Battery::getAnimation() const
{
return this->animation;
}
void Battery::setAnimation(bool animation)
{
if (this->animation != animation) {
@ -331,6 +277,11 @@ void Battery::setAnimation(bool animation)
}
}
double Battery::getAnimationStep() const
{
return this->animationStep;
}
void Battery::setAnimationStep(double animationStep)
{
if (this->animationStep != animationStep) {
@ -339,6 +290,11 @@ void Battery::setAnimationStep(double animationStep)
}
}
int Battery::getBorderWidth() const
{
return this->borderWidth;
}
void Battery::setBorderWidth(int borderWidth)
{
if (this->borderWidth != borderWidth) {
@ -347,6 +303,11 @@ void Battery::setBorderWidth(int borderWidth)
}
}
int Battery::getBorderRadius() const
{
return this->borderRadius;
}
void Battery::setBorderRadius(int borderRadius)
{
if (this->borderRadius != borderRadius) {
@ -355,6 +316,11 @@ void Battery::setBorderRadius(int borderRadius)
}
}
int Battery::getBgRadius() const
{
return this->bgRadius;
}
void Battery::setBgRadius(int bgRadius)
{
if (this->bgRadius != bgRadius) {
@ -363,6 +329,11 @@ void Battery::setBgRadius(int bgRadius)
}
}
int Battery::getHeadRadius() const
{
return this->headRadius;
}
void Battery::setHeadRadius(int headRadius)
{
if (this->headRadius != headRadius) {
@ -371,6 +342,11 @@ void Battery::setHeadRadius(int headRadius)
}
}
QColor Battery::getBorderColorStart() const
{
return this->borderColorStart;
}
void Battery::setBorderColorStart(const QColor &borderColorStart)
{
if (this->borderColorStart != borderColorStart) {
@ -379,6 +355,11 @@ void Battery::setBorderColorStart(const QColor &borderColorStart)
}
}
QColor Battery::getBorderColorEnd() const
{
return this->borderColorEnd;
}
void Battery::setBorderColorEnd(const QColor &borderColorEnd)
{
if (this->borderColorEnd != borderColorEnd) {
@ -387,6 +368,11 @@ void Battery::setBorderColorEnd(const QColor &borderColorEnd)
}
}
QColor Battery::getAlarmColorStart() const
{
return this->alarmColorStart;
}
void Battery::setAlarmColorStart(const QColor &alarmColorStart)
{
if (this->alarmColorStart != alarmColorStart) {
@ -395,6 +381,11 @@ void Battery::setAlarmColorStart(const QColor &alarmColorStart)
}
}
QColor Battery::getAlarmColorEnd() const
{
return this->alarmColorEnd;
}
void Battery::setAlarmColorEnd(const QColor &alarmColorEnd)
{
if (this->alarmColorEnd != alarmColorEnd) {
@ -403,6 +394,11 @@ void Battery::setAlarmColorEnd(const QColor &alarmColorEnd)
}
}
QColor Battery::getNormalColorStart() const
{
return this->normalColorStart;
}
void Battery::setNormalColorStart(const QColor &normalColorStart)
{
if (this->normalColorStart != normalColorStart) {
@ -411,6 +407,11 @@ void Battery::setNormalColorStart(const QColor &normalColorStart)
}
}
QColor Battery::getNormalColorEnd() const
{
return this->normalColorEnd;
}
void Battery::setNormalColorEnd(const QColor &normalColorEnd)
{
if (this->normalColorEnd != normalColorEnd) {
@ -418,4 +419,3 @@ void Battery::setNormalColorEnd(const QColor &normalColorEnd)
this->update();
}
}

View File

@ -71,13 +71,13 @@ private:
int bgRadius; //背景进度圆角角度
int headRadius; //头部圆角角度
QColor borderColorStart; //边框渐变开始颜色
QColor borderColorStart;//边框渐变开始颜色
QColor borderColorEnd; //边框渐变结束颜色
QColor alarmColorStart; //电池低电量时的渐变开始颜色
QColor alarmColorEnd; //电池低电量时的渐变结束颜色
QColor normalColorStart; //电池正常电量时的渐变开始颜色
QColor normalColorStart;//电池正常电量时的渐变开始颜色
QColor normalColorEnd; //电池正常电量时的渐变结束颜色
bool isForward; //是否往前移
@ -86,74 +86,79 @@ private:
QTimer *timer; //绘制定时器
public:
double getMinValue() const;
double getMaxValue() const;
double getValue() const;
double getAlarmValue() const;
bool getAnimation() const;
double getAnimationStep() const;
int getBorderWidth() const;
int getBorderRadius() const;
int getBgRadius() const;
int getHeadRadius() const;
QColor getBorderColorStart() const;
QColor getBorderColorEnd() const;
QColor getAlarmColorStart() const;
QColor getAlarmColorEnd() const;
QColor getNormalColorStart() const;
QColor getNormalColorEnd() const;
//默认尺寸和最小尺寸
QSize sizeHint() const;
QSize minimumSizeHint() const;
public Q_SLOTS:
//设置范围值
void setRange(double minValue, double maxValue);
void setRange(int minValue, int maxValue);
//设置最大最小值
//获取和设置最小值
double getMinValue() const;
void setMinValue(double minValue);
//获取和设置最大值
double getMaxValue() const;
void setMaxValue(double maxValue);
//设置电池电量值
//获取和设置电池电量值
double getValue() const;
void setValue(double value);
void setValue(int value);
//设置电池电量警戒值
//获取和设置电池电量警戒值
double getAlarmValue() const;
void setAlarmValue(double alarmValue);
void setAlarmValue(int alarmValue);
//设置是否启用动画显示
//获取和设置是否启用动画显示
bool getAnimation() const;
void setAnimation(bool animation);
//设置动画显示的步长
//获取和设置动画显示的步长
double getAnimationStep() const;
void setAnimationStep(double animationStep);
//设置边框粗细
//获取和设置边框粗细
int getBorderWidth() const;
void setBorderWidth(int borderWidth);
//设置边框圆角角度
//获取和设置边框圆角角度
int getBorderRadius() const;
void setBorderRadius(int borderRadius);
//设置背景圆角角度
//获取和设置背景圆角角度
int getBgRadius() const;
void setBgRadius(int bgRadius);
//设置头部圆角角度
//获取和设置头部圆角角度
int getHeadRadius() const;
void setHeadRadius(int headRadius);
//设置边框渐变颜色
//获取和设置边框渐变颜色
QColor getBorderColorStart() const;
void setBorderColorStart(const QColor &borderColorStart);
QColor getBorderColorEnd() const;
void setBorderColorEnd(const QColor &borderColorEnd);
//设置电池电量报警时的渐变颜色
//获取和设置电池电量报警时的渐变颜色
QColor getAlarmColorStart() const;
void setAlarmColorStart(const QColor &alarmColorStart);
QColor getAlarmColorEnd() const;
void setAlarmColorEnd(const QColor &alarmColorEnd);
//设置电池电量正常时的渐变颜色
//获取和设置电池电量正常时的渐变颜色
QColor getNormalColorStart() const;
void setNormalColorStart(const QColor &normalColorStart);
QColor getNormalColorEnd() const;
void setNormalColorEnd(const QColor &normalColorEnd);
public Q_SLOTS:
void setValue(int value);
void setAlarmValue(int alarmValue);
Q_SIGNALS:
void valueChanged(double value);
};

View File

@ -114,36 +114,6 @@ bool DeviceButton::eventFilter(QObject *watched, QEvent *event)
return QWidget::eventFilter(watched, event);
}
bool DeviceButton::getCanMove() const
{
return this->canMove;
}
QString DeviceButton::getText() const
{
return this->text;
}
QString DeviceButton::getColorNormal() const
{
return this->colorNormal;
}
QString DeviceButton::getColorAlarm() const
{
return this->colorAlarm;
}
DeviceButton::ButtonStyle DeviceButton::getButtonStyle() const
{
return this->buttonStyle;
}
DeviceButton::ButtonColor DeviceButton::getButtonColor() const
{
return this->buttonColor;
}
QSize DeviceButton::sizeHint() const
{
return QSize(50, 50);
@ -166,11 +136,21 @@ void DeviceButton::checkAlarm()
this->update();
}
bool DeviceButton::getCanMove() const
{
return this->canMove;
}
void DeviceButton::setCanMove(bool canMove)
{
this->canMove = canMove;
}
QString DeviceButton::getText() const
{
return this->text;
}
void DeviceButton::setText(const QString &text)
{
if (this->text != text) {
@ -179,6 +159,11 @@ void DeviceButton::setText(const QString &text)
}
}
QString DeviceButton::getColorNormal() const
{
return this->colorNormal;
}
void DeviceButton::setColorNormal(const QString &colorNormal)
{
if (this->colorNormal != colorNormal) {
@ -187,6 +172,11 @@ void DeviceButton::setColorNormal(const QString &colorNormal)
}
}
QString DeviceButton::getColorAlarm() const
{
return this->colorAlarm;
}
void DeviceButton::setColorAlarm(const QString &colorAlarm)
{
if (this->colorAlarm != colorAlarm) {
@ -195,6 +185,11 @@ void DeviceButton::setColorAlarm(const QString &colorAlarm)
}
}
DeviceButton::ButtonStyle DeviceButton::getButtonStyle() const
{
return this->buttonStyle;
}
void DeviceButton::setButtonStyle(const DeviceButton::ButtonStyle &buttonStyle)
{
this->buttonStyle = buttonStyle;
@ -217,6 +212,11 @@ void DeviceButton::setButtonStyle(const DeviceButton::ButtonStyle &buttonStyle)
setButtonColor(buttonColor);
}
DeviceButton::ButtonColor DeviceButton::getButtonColor() const
{
return this->buttonColor;
}
void DeviceButton::setButtonColor(const DeviceButton::ButtonColor &buttonColor)
{
//先停止定时器

View File

@ -46,13 +46,13 @@ public:
//设备按钮颜色
enum ButtonColor {
ButtonColor_Green = 0, //绿色 激活状态
ButtonColor_Blue = 1, //蓝色 在线状态
ButtonColor_Red = 2, //红色 报警状态
ButtonColor_Gray = 3, //灰色 离线状态
ButtonColor_Black = 4, //黑色 故障状态
ButtonColor_Purple = 5, //紫色 其他状态
ButtonColor_Yellow = 6 //黄色 其他状态
ButtonColor_Green = 0, //绿色(激活状态)
ButtonColor_Blue = 1, //蓝色(在线状态)
ButtonColor_Red = 2, //红色(报警状态)
ButtonColor_Gray = 3, //灰色(离线状态)
ButtonColor_Black = 4, //黑色(故障状态)
ButtonColor_Purple = 5, //紫色(其他状态)
ButtonColor_Yellow = 6 //黄色(其他状态)
};
explicit DeviceButton(QWidget *parent = 0);
@ -69,8 +69,8 @@ private:
QString colorNormal; //正常颜色
QString colorAlarm; //报警颜色
ButtonStyle buttonStyle; //按钮样式
ButtonColor buttonColor; //按钮颜色
ButtonStyle buttonStyle;//按钮样式
ButtonColor buttonColor;//按钮颜色
bool isPressed; //鼠标是否按下
QPoint lastPoint; //鼠标按下最后坐标
@ -86,31 +86,32 @@ private slots:
void checkAlarm(); //切换报警状态
public:
bool getCanMove() const;
QString getText() const;
QString getColorNormal() const;
QString getColorAlarm() const;
ButtonStyle getButtonStyle() const;
ButtonColor getButtonColor() const;
//默认尺寸和最小尺寸
QSize sizeHint() const;
QSize minimumSizeHint() const;
public Q_SLOTS:
//设置可移动
//获取和设置可移动
bool getCanMove() const;
void setCanMove(bool canMove);
//设置显示文字
//获取和设置显示文字
QString getText() const;
void setText(const QString &text);
//设置正常颜色和报警颜色
//获取和设置正常颜色
QString getColorNormal() const;
void setColorNormal(const QString &colorNormal);
//获取和设置报警颜色
QString getColorAlarm() const;
void setColorAlarm(const QString &colorAlarm);
//设置样式
//获取和设置样式
ButtonStyle getButtonStyle() const;
void setButtonStyle(const ButtonStyle &buttonStyle);
//设置颜色
//获取和设置颜色
ButtonColor getButtonColor() const;
void setButtonColor(const ButtonColor &buttonColor);
Q_SIGNALS:

View File

@ -59,128 +59,6 @@ DeviceSizeTable::DeviceSizeTable(QWidget *parent) : QTableWidget(parent)
//QTimer::singleShot(10, this, SLOT(load()));
}
QColor DeviceSizeTable::getBgColor() const
{
return this->bgColor;
}
QColor DeviceSizeTable::getChunkColor1() const
{
return this->chunkColor1;
}
QColor DeviceSizeTable::getChunkColor2() const
{
return this->chunkColor2;
}
QColor DeviceSizeTable::getChunkColor3() const
{
return this->chunkColor3;
}
QColor DeviceSizeTable::getTextColor1() const
{
return this->textColor1;
}
QColor DeviceSizeTable::getTextColor2() const
{
return this->textColor2;
}
QColor DeviceSizeTable::getTextColor3() const
{
return this->textColor3;
}
void DeviceSizeTable::load()
{
//清空原有数据
int row = this->rowCount();
for (int i = 0; i < row; ++i) {
this->removeRow(0);
}
#ifdef Q_OS_WIN
QFileInfoList list = QDir::drives();
foreach (QFileInfo dir, list) {
QString dirName = dir.absolutePath();
LPCWSTR lpcwstrDriver = (LPCWSTR)dirName.utf16();
ULARGE_INTEGER liFreeBytesAvailable, liTotalBytes, liTotalFreeBytes;
if (GetDiskFreeSpaceEx(lpcwstrDriver, &liFreeBytesAvailable, &liTotalBytes, &liTotalFreeBytes)) {
QString use = QString::number((double)(liTotalBytes.QuadPart - liTotalFreeBytes.QuadPart) / GB, 'f', 1);
use += "G";
QString free = QString::number((double) liTotalFreeBytes.QuadPart / GB, 'f', 1);
free += "G";
QString all = QString::number((double) liTotalBytes.QuadPart / GB, 'f', 1);
all += "G";
int percent = 100 - ((double)liTotalFreeBytes.QuadPart / liTotalBytes.QuadPart) * 100;
insertSize(dirName, use, free, all, percent);
}
}
#elif defined(Q_OS_UNIX) && !defined(Q_OS_WASM)
process->start("df", QStringList() << "-h");
#endif
}
void DeviceSizeTable::setBgColor(const QColor &bgColor)
{
if (this->bgColor != bgColor) {
this->bgColor = bgColor;
this->load();
}
}
void DeviceSizeTable::setChunkColor1(const QColor &chunkColor1)
{
if (this->chunkColor1 != chunkColor1) {
this->chunkColor1 = chunkColor1;
this->load();
}
}
void DeviceSizeTable::setChunkColor2(const QColor &chunkColor2)
{
if (this->chunkColor2 != chunkColor2) {
this->chunkColor2 = chunkColor2;
this->load();
}
}
void DeviceSizeTable::setChunkColor3(const QColor &chunkColor3)
{
if (this->chunkColor3 != chunkColor3) {
this->chunkColor3 = chunkColor3;
this->load();
}
}
void DeviceSizeTable::setTextColor1(const QColor &textColor1)
{
if (this->textColor1 != textColor1) {
this->textColor1 = textColor1;
this->load();
}
}
void DeviceSizeTable::setTextColor2(const QColor &textColor2)
{
if (this->textColor2 != textColor2) {
this->textColor2 = textColor2;
this->load();
}
}
void DeviceSizeTable::setTextColor3(const QColor &textColor3)
{
if (this->textColor3 != textColor3) {
this->textColor3 = textColor3;
this->load();
}
}
void DeviceSizeTable::readData()
{
#if defined(Q_OS_UNIX) && !defined(Q_OS_WASM)
@ -292,3 +170,125 @@ QSize DeviceSizeTable::minimumSizeHint() const
{
return QSize(200, 150);
}
QColor DeviceSizeTable::getBgColor() const
{
return this->bgColor;
}
void DeviceSizeTable::setBgColor(const QColor &bgColor)
{
if (this->bgColor != bgColor) {
this->bgColor = bgColor;
this->load();
}
}
QColor DeviceSizeTable::getChunkColor1() const
{
return this->chunkColor1;
}
void DeviceSizeTable::setChunkColor1(const QColor &chunkColor1)
{
if (this->chunkColor1 != chunkColor1) {
this->chunkColor1 = chunkColor1;
this->load();
}
}
QColor DeviceSizeTable::getChunkColor2() const
{
return this->chunkColor2;
}
void DeviceSizeTable::setChunkColor2(const QColor &chunkColor2)
{
if (this->chunkColor2 != chunkColor2) {
this->chunkColor2 = chunkColor2;
this->load();
}
}
QColor DeviceSizeTable::getChunkColor3() const
{
return this->chunkColor3;
}
void DeviceSizeTable::setChunkColor3(const QColor &chunkColor3)
{
if (this->chunkColor3 != chunkColor3) {
this->chunkColor3 = chunkColor3;
this->load();
}
}
QColor DeviceSizeTable::getTextColor1() const
{
return this->textColor1;
}
void DeviceSizeTable::setTextColor1(const QColor &textColor1)
{
if (this->textColor1 != textColor1) {
this->textColor1 = textColor1;
this->load();
}
}
QColor DeviceSizeTable::getTextColor2() const
{
return this->textColor2;
}
void DeviceSizeTable::setTextColor2(const QColor &textColor2)
{
if (this->textColor2 != textColor2) {
this->textColor2 = textColor2;
this->load();
}
}
QColor DeviceSizeTable::getTextColor3() const
{
return this->textColor3;
}
void DeviceSizeTable::setTextColor3(const QColor &textColor3)
{
if (this->textColor3 != textColor3) {
this->textColor3 = textColor3;
this->load();
}
}
void DeviceSizeTable::load()
{
//清空原有数据
int row = this->rowCount();
for (int i = 0; i < row; ++i) {
this->removeRow(0);
}
#ifdef Q_OS_WIN
QFileInfoList list = QDir::drives();
foreach (QFileInfo dir, list) {
QString dirName = dir.absolutePath();
LPCWSTR lpcwstrDriver = (LPCWSTR)dirName.utf16();
ULARGE_INTEGER liFreeBytesAvailable, liTotalBytes, liTotalFreeBytes;
if (GetDiskFreeSpaceEx(lpcwstrDriver, &liFreeBytesAvailable, &liTotalBytes, &liTotalFreeBytes)) {
QString use = QString::number((double)(liTotalBytes.QuadPart - liTotalFreeBytes.QuadPart) / GB, 'f', 1);
use += "G";
QString free = QString::number((double) liTotalFreeBytes.QuadPart / GB, 'f', 1);
free += "G";
QString all = QString::number((double) liTotalBytes.QuadPart / GB, 'f', 1);
all += "G";
int percent = 100 - ((double)liTotalFreeBytes.QuadPart / liTotalBytes.QuadPart) * 100;
insertSize(dirName, use, free, all, percent);
}
}
#elif defined(Q_OS_UNIX) && !defined(Q_OS_WASM)
process->start("df", QStringList() << "-h");
#endif
}

View File

@ -26,6 +26,7 @@ class DeviceSizeTable : public QTableWidget
Q_PROPERTY(QColor chunkColor1 READ getChunkColor1 WRITE setChunkColor1)
Q_PROPERTY(QColor chunkColor2 READ getChunkColor2 WRITE setChunkColor2)
Q_PROPERTY(QColor chunkColor3 READ getChunkColor3 WRITE setChunkColor3)
Q_PROPERTY(QColor textColor1 READ getTextColor1 WRITE setTextColor1)
Q_PROPERTY(QColor textColor2 READ getTextColor2 WRITE setTextColor2)
Q_PROPERTY(QColor textColor3 READ getTextColor3 WRITE setTextColor3)
@ -40,6 +41,7 @@ private:
QColor chunkColor1; //进度颜色1
QColor chunkColor2; //进度颜色2
QColor chunkColor3; //进度颜色3
QColor textColor1; //文字颜色1
QColor textColor2; //文字颜色2
QColor textColor3; //文字颜色3
@ -50,34 +52,42 @@ private slots:
void insertSize(const QString &name, const QString &use, const QString &free, const QString &all, int percent);
public:
QColor getBgColor() const;
QColor getChunkColor1() const;
QColor getChunkColor2() const;
QColor getChunkColor3() const;
QColor getTextColor1() const;
QColor getTextColor2() const;
QColor getTextColor3() const;
//默认尺寸和最小尺寸
QSize sizeHint() const;
QSize minimumSizeHint() const;
//获取和设置背景颜色
QColor getBgColor() const;
void setBgColor(const QColor &bgColor);
//获取和设置进度颜色1
QColor getChunkColor1() const;
void setChunkColor1(const QColor &chunkColor1);
//获取和设置进度颜色2
QColor getChunkColor2() const;
void setChunkColor2(const QColor &chunkColor2);
//获取和设置进度颜色3
QColor getChunkColor3() const;
void setChunkColor3(const QColor &chunkColor3);
//获取和设置文字颜色1
QColor getTextColor1() const;
void setTextColor1(const QColor &textColor1);
//获取和设置文字颜色2
QColor getTextColor2() const;
void setTextColor2(const QColor &textColor2);
//获取和设置文字颜色3
QColor getTextColor3() const;
void setTextColor3(const QColor &textColor3);
public Q_SLOTS:
//载入容量
void load();
//设置背景颜色
void setBgColor(const QColor &bgColor);
//设置进度颜色
void setChunkColor1(const QColor &chunkColor1);
void setChunkColor2(const QColor &chunkColor2);
void setChunkColor3(const QColor &chunkColor3);
//设置文字颜色
void setTextColor1(const QColor &textColor1);
void setTextColor2(const QColor &textColor2);
void setTextColor3(const QColor &textColor3);
Q_SIGNALS:
void sdcardReceive(const QString &sdcardName);
void udiskReceive(const QString &udiskName);

View File

@ -36,16 +36,6 @@ void ImageSwitch::paintEvent(QPaintEvent *)
painter.drawImage(point, img);
}
bool ImageSwitch::getChecked() const
{
return isChecked;
}
ImageSwitch::ButtonStyle ImageSwitch::getButtonStyle() const
{
return this->buttonStyle;
}
QSize ImageSwitch::sizeHint() const
{
return QSize(87, 28);
@ -56,6 +46,11 @@ QSize ImageSwitch::minimumSizeHint() const
return QSize(87, 28);
}
bool ImageSwitch::getChecked() const
{
return isChecked;
}
void ImageSwitch::setChecked(bool isChecked)
{
if (this->isChecked != isChecked) {
@ -65,6 +60,11 @@ void ImageSwitch::setChecked(bool isChecked)
}
}
ImageSwitch::ButtonStyle ImageSwitch::getButtonStyle() const
{
return this->buttonStyle;
}
void ImageSwitch::setButtonStyle(const ImageSwitch::ButtonStyle &buttonStyle)
{
if (this->buttonStyle != buttonStyle) {

View File

@ -36,24 +36,24 @@ protected:
void paintEvent(QPaintEvent *event);
private:
bool isChecked;
ButtonStyle buttonStyle;
bool isChecked; //是否选中
ButtonStyle buttonStyle; //按钮样式
QString imgOffFile;
QString imgOnFile;
QString imgFile;
QString imgOffFile; //关闭图片
QString imgOnFile; //开启图片
QString imgFile; //当前图片
public:
bool getChecked() const;
ButtonStyle getButtonStyle() const;
//默认尺寸和最小尺寸
QSize sizeHint() const;
QSize minimumSizeHint() const;
public Q_SLOTS:
//设置是否选中
//获取和设置是否选中
bool getChecked() const;
void setChecked(bool isChecked);
//设置按钮样式
//获取和设置按钮样式
ButtonStyle getButtonStyle() const;
void setButtonStyle(const ImageSwitch::ButtonStyle &buttonStyle);
Q_SIGNALS:

View File

@ -144,11 +144,6 @@ void IPAddress::textChanged(const QString &text)
ip = QString("%1.%2.%3.%4").arg(txtIP1->text()).arg(txtIP2->text()).arg(txtIP3->text()).arg(txtIP4->text());
}
QString IPAddress::getIP() const
{
return this->ip;
}
QSize IPAddress::sizeHint() const
{
return QSize(250, 20);
@ -159,6 +154,11 @@ QSize IPAddress::minimumSizeHint() const
return QSize(30, 10);
}
QString IPAddress::getIP() const
{
return this->ip;
}
void IPAddress::setIP(const QString &ip)
{
//先检测IP地址是否合法

View File

@ -52,15 +52,14 @@ private slots:
void textChanged(const QString &text);
public:
//获取IP地址
QString getIP() const;
//默认尺寸和最小尺寸
QSize sizeHint() const;
QSize minimumSizeHint() const;
public Q_SLOTS:
//设置IP地址
//获取和设置IP地址
QString getIP() const;
void setIP(const QString &ip);
//清空
void clear();
@ -70,7 +69,6 @@ public Q_SLOTS:
void setBorderColor(const QString &borderColor);
//设置边框圆角角度
void setBorderRadius(int borderRadius);
};
#endif // IPADDRESS_H

Binary file not shown.

View File

@ -185,71 +185,6 @@ void LightButton::drawOverlay(QPainter *painter)
painter->restore();
}
QString LightButton::getText() const
{
return this->text;
}
QColor LightButton::getTextColor() const
{
return this->textColor;
}
QColor LightButton::getAlarmColor() const
{
return this->alarmColor;
}
QColor LightButton::getNormalColor() const
{
return this->normalColor;
}
QColor LightButton::getBorderOutColorStart() const
{
return this->borderOutColorStart;
}
QColor LightButton::getBorderOutColorEnd() const
{
return this->borderOutColorEnd;
}
QColor LightButton::getBorderInColorStart() const
{
return this->borderInColorStart;
}
QColor LightButton::getBorderInColorEnd() const
{
return this->borderInColorEnd;
}
QColor LightButton::getBgColor() const
{
return this->bgColor;
}
bool LightButton::getCanMove() const
{
return this->canMove;
}
bool LightButton::getShowRect() const
{
return this->showRect;
}
bool LightButton::getShowOverlay() const
{
return this->showOverlay;
}
QColor LightButton::getOverlayColor() const
{
return this->overlayColor;
}
QSize LightButton::sizeHint() const
{
return QSize(100, 100);
@ -260,6 +195,11 @@ QSize LightButton::minimumSizeHint() const
return QSize(10, 10);
}
QString LightButton::getText() const
{
return this->text;
}
void LightButton::setText(const QString &text)
{
if (this->text != text) {
@ -268,6 +208,11 @@ void LightButton::setText(const QString &text)
}
}
QColor LightButton::getTextColor() const
{
return this->textColor;
}
void LightButton::setTextColor(const QColor &textColor)
{
if (this->textColor != textColor) {
@ -276,6 +221,11 @@ void LightButton::setTextColor(const QColor &textColor)
}
}
QColor LightButton::getAlarmColor() const
{
return this->alarmColor;
}
void LightButton::setAlarmColor(const QColor &alarmColor)
{
if (this->alarmColor != alarmColor) {
@ -284,6 +234,11 @@ void LightButton::setAlarmColor(const QColor &alarmColor)
}
}
QColor LightButton::getNormalColor() const
{
return this->normalColor;
}
void LightButton::setNormalColor(const QColor &normalColor)
{
if (this->normalColor != normalColor) {
@ -292,6 +247,11 @@ void LightButton::setNormalColor(const QColor &normalColor)
}
}
QColor LightButton::getBorderOutColorStart() const
{
return this->borderOutColorStart;
}
void LightButton::setBorderOutColorStart(const QColor &borderOutColorStart)
{
if (this->borderOutColorStart != borderOutColorStart) {
@ -300,6 +260,11 @@ void LightButton::setBorderOutColorStart(const QColor &borderOutColorStart)
}
}
QColor LightButton::getBorderOutColorEnd() const
{
return this->borderOutColorEnd;
}
void LightButton::setBorderOutColorEnd(const QColor &borderOutColorEnd)
{
if (this->borderOutColorEnd != borderOutColorEnd) {
@ -308,6 +273,11 @@ void LightButton::setBorderOutColorEnd(const QColor &borderOutColorEnd)
}
}
QColor LightButton::getBorderInColorStart() const
{
return this->borderInColorStart;
}
void LightButton::setBorderInColorStart(const QColor &borderInColorStart)
{
if (this->borderInColorStart != borderInColorStart) {
@ -316,6 +286,11 @@ void LightButton::setBorderInColorStart(const QColor &borderInColorStart)
}
}
QColor LightButton::getBorderInColorEnd() const
{
return this->borderInColorEnd;
}
void LightButton::setBorderInColorEnd(const QColor &borderInColorEnd)
{
if (this->borderInColorEnd != borderInColorEnd) {
@ -324,6 +299,11 @@ void LightButton::setBorderInColorEnd(const QColor &borderInColorEnd)
}
}
QColor LightButton::getBgColor() const
{
return this->bgColor;
}
void LightButton::setBgColor(const QColor &bgColor)
{
if (this->bgColor != bgColor) {
@ -332,6 +312,11 @@ void LightButton::setBgColor(const QColor &bgColor)
}
}
bool LightButton::getCanMove() const
{
return this->canMove;
}
void LightButton::setCanMove(bool canMove)
{
if (this->canMove != canMove) {
@ -340,6 +325,11 @@ void LightButton::setCanMove(bool canMove)
}
}
bool LightButton::getShowRect() const
{
return this->showRect;
}
void LightButton::setShowRect(bool showRect)
{
if (this->showRect != showRect) {
@ -348,6 +338,11 @@ void LightButton::setShowRect(bool showRect)
}
}
bool LightButton::getShowOverlay() const
{
return this->showOverlay;
}
void LightButton::setShowOverlay(bool showOverlay)
{
if (this->showOverlay != showOverlay) {
@ -356,6 +351,11 @@ void LightButton::setShowOverlay(bool showOverlay)
}
}
QColor LightButton::getOverlayColor() const
{
return this->overlayColor;
}
void LightButton::setOverlayColor(const QColor &overlayColor)
{
if (this->overlayColor != overlayColor) {

View File

@ -78,55 +78,61 @@ private:
QTimer *timerAlarm; //定时器切换颜色
public:
QString getText() const;
QColor getTextColor() const;
QColor getAlarmColor() const;
QColor getNormalColor() const;
QColor getBorderOutColorStart() const;
QColor getBorderOutColorEnd() const;
QColor getBorderInColorStart() const;
QColor getBorderInColorEnd() const;
QColor getBgColor() const;
bool getCanMove() const;
bool getShowRect() const;
bool getShowOverlay() const;
QColor getOverlayColor() const;
//默认尺寸和最小尺寸
QSize sizeHint() const;
QSize minimumSizeHint() const;
public Q_SLOTS:
//设置文本
//获取和设置文本
QString getText() const;
void setText(const QString &text);
//设置文本颜色
//获取和设置文本颜色
QColor getTextColor() const;
void setTextColor(const QColor &textColor);
//设置报警颜色+正常颜色
//获取和设置报警颜色
QColor getAlarmColor() const;
void setAlarmColor(const QColor &alarmColor);
//获取和设置正常颜色
QColor getNormalColor() const;
void setNormalColor(const QColor &normalColor);
//设置外边框渐变颜色
//获取和设置外边框渐变颜色
QColor getBorderOutColorStart() const;
void setBorderOutColorStart(const QColor &borderOutColorStart);
QColor getBorderOutColorEnd() const;
void setBorderOutColorEnd(const QColor &borderOutColorEnd);
//设置里边框渐变颜色
//获取和设置里边框渐变颜色
QColor getBorderInColorStart() const;
void setBorderInColorStart(const QColor &borderInColorStart);
QColor getBorderInColorEnd() const;
void setBorderInColorEnd(const QColor &borderInColorEnd);
//设置背景色
//获取和设置背景色
QColor getBgColor() const;
void setBgColor(const QColor &bgColor);
//设置是否可移动
//获取和设置是否可移动
bool getCanMove() const;
void setCanMove(bool canMove);
//设置是否显示矩形
//获取和设置是否显示矩形
bool getShowRect() const;
void setShowRect(bool showRect);
//设置是否显示遮罩层
//获取和设置是否显示遮罩层
bool getShowOverlay() const;
void setShowOverlay(bool showOverlay);
//设置遮罩层颜色
//获取和设置遮罩层颜色
QColor getOverlayColor() const;
void setOverlayColor(const QColor &overlayColor);
public Q_SLOTS:
//设置为绿色
void setGreen();
//设置为红色
@ -139,6 +145,7 @@ public Q_SLOTS:
void setGray();
//设置为蓝色
void setBlue();
//设置为淡蓝色
void setLightBlue();
//设置为淡红色

View File

@ -249,136 +249,6 @@ void NavButton::drawTriangle(QPainter *painter)
painter->restore();
}
int NavButton::getPaddingLeft() const
{
return this->paddingLeft;
}
int NavButton::getPaddingRight() const
{
return this->paddingRight;
}
int NavButton::getPaddingTop() const
{
return this->paddingTop;
}
int NavButton::getPaddingBottom() const
{
return this->paddingBottom;
}
NavButton::TextAlign NavButton::getTextAlign() const
{
return this->textAlign;
}
bool NavButton::getShowTriangle() const
{
return this->showTriangle;
}
int NavButton::getTriangleLen() const
{
return this->triangleLen;
}
NavButton::TrianglePosition NavButton::getTrianglePosition() const
{
return this->trianglePosition;
}
QColor NavButton::getTriangleColor() const
{
return this->triangleColor;
}
bool NavButton::getShowIcon() const
{
return this->showIcon;
}
int NavButton::getIconSpace() const
{
return this->iconSpace;
}
QSize NavButton::getIconSize() const
{
return this->iconSize;
}
QPixmap NavButton::getIconNormal() const
{
return this->iconNormal;
}
QPixmap NavButton::getIconHover() const
{
return this->iconHover;
}
QPixmap NavButton::getIconCheck() const
{
return this->iconCheck;
}
bool NavButton::getShowLine() const
{
return this->showLine;
}
int NavButton::getLineSpace() const
{
return this->lineSpace;
}
int NavButton::getLineWidth() const
{
return this->lineWidth;
}
NavButton::LinePosition NavButton::getLinePosition() const
{
return this->linePosition;
}
QColor NavButton::getLineColor() const
{
return this->lineColor;
}
QColor NavButton::getNormalBgColor() const
{
return this->normalBgColor;
}
QColor NavButton::getHoverBgColor() const
{
return this->hoverBgColor;
}
QColor NavButton::getCheckBgColor() const
{
return this->checkBgColor;
}
QColor NavButton::getNormalTextColor() const
{
return this->normalTextColor;
}
QColor NavButton::getHoverTextColor() const
{
return this->hoverTextColor;
}
QColor NavButton::getCheckTextColor() const
{
return this->checkTextColor;
}
QSize NavButton::sizeHint() const
{
return QSize(100, 30);
@ -389,6 +259,11 @@ QSize NavButton::minimumSizeHint() const
return QSize(20, 10);
}
int NavButton::getPaddingLeft() const
{
return this->paddingLeft;
}
void NavButton::setPaddingLeft(int paddingLeft)
{
if (this->paddingLeft != paddingLeft) {
@ -397,6 +272,11 @@ void NavButton::setPaddingLeft(int paddingLeft)
}
}
int NavButton::getPaddingRight() const
{
return this->paddingRight;
}
void NavButton::setPaddingRight(int paddingRight)
{
if (this->paddingRight != paddingRight) {
@ -405,6 +285,11 @@ void NavButton::setPaddingRight(int paddingRight)
}
}
int NavButton::getPaddingTop() const
{
return this->paddingTop;
}
void NavButton::setPaddingTop(int paddingTop)
{
if (this->paddingTop != paddingTop) {
@ -413,6 +298,11 @@ void NavButton::setPaddingTop(int paddingTop)
}
}
int NavButton::getPaddingBottom() const
{
return this->paddingBottom;
}
void NavButton::setPaddingBottom(int paddingBottom)
{
if (this->paddingBottom != paddingBottom) {
@ -435,6 +325,11 @@ void NavButton::setPadding(int paddingLeft, int paddingRight, int paddingTop, in
this->update();
}
NavButton::TextAlign NavButton::getTextAlign() const
{
return this->textAlign;
}
void NavButton::setTextAlign(const NavButton::TextAlign &textAlign)
{
if (this->textAlign != textAlign) {
@ -443,6 +338,11 @@ void NavButton::setTextAlign(const NavButton::TextAlign &textAlign)
}
}
bool NavButton::getShowTriangle() const
{
return this->showTriangle;
}
void NavButton::setShowTriangle(bool showTriangle)
{
if (this->showTriangle != showTriangle) {
@ -451,6 +351,11 @@ void NavButton::setShowTriangle(bool showTriangle)
}
}
int NavButton::getTriangleLen() const
{
return this->triangleLen;
}
void NavButton::setTriangleLen(int triangleLen)
{
if (this->triangleLen != triangleLen) {
@ -459,6 +364,11 @@ void NavButton::setTriangleLen(int triangleLen)
}
}
NavButton::TrianglePosition NavButton::getTrianglePosition() const
{
return this->trianglePosition;
}
void NavButton::setTrianglePosition(const NavButton::TrianglePosition &trianglePosition)
{
if (this->trianglePosition != trianglePosition) {
@ -467,6 +377,11 @@ void NavButton::setTrianglePosition(const NavButton::TrianglePosition &triangleP
}
}
QColor NavButton::getTriangleColor() const
{
return this->triangleColor;
}
void NavButton::setTriangleColor(const QColor &triangleColor)
{
if (this->triangleColor != triangleColor) {
@ -475,6 +390,11 @@ void NavButton::setTriangleColor(const QColor &triangleColor)
}
}
bool NavButton::getShowIcon() const
{
return this->showIcon;
}
void NavButton::setShowIcon(bool showIcon)
{
if (this->showIcon != showIcon) {
@ -483,6 +403,11 @@ void NavButton::setShowIcon(bool showIcon)
}
}
int NavButton::getIconSpace() const
{
return this->iconSpace;
}
void NavButton::setIconSpace(int iconSpace)
{
if (this->iconSpace != iconSpace) {
@ -491,6 +416,11 @@ void NavButton::setIconSpace(int iconSpace)
}
}
QSize NavButton::getIconSize() const
{
return this->iconSize;
}
void NavButton::setIconSize(const QSize &iconSize)
{
if (this->iconSize != iconSize) {
@ -499,24 +429,44 @@ void NavButton::setIconSize(const QSize &iconSize)
}
}
QPixmap NavButton::getIconNormal() const
{
return this->iconNormal;
}
void NavButton::setIconNormal(const QPixmap &iconNormal)
{
this->iconNormal = iconNormal;
this->update();
}
QPixmap NavButton::getIconHover() const
{
return this->iconHover;
}
void NavButton::setIconHover(const QPixmap &iconHover)
{
this->iconHover = iconHover;
this->update();
}
QPixmap NavButton::getIconCheck() const
{
return this->iconCheck;
}
void NavButton::setIconCheck(const QPixmap &iconCheck)
{
this->iconCheck = iconCheck;
this->update();
}
bool NavButton::getShowLine() const
{
return this->showLine;
}
void NavButton::setShowLine(bool showLine)
{
if (this->showLine != showLine) {
@ -525,6 +475,11 @@ void NavButton::setShowLine(bool showLine)
}
}
int NavButton::getLineSpace() const
{
return this->lineSpace;
}
void NavButton::setLineSpace(int lineSpace)
{
if (this->lineSpace != lineSpace) {
@ -533,6 +488,11 @@ void NavButton::setLineSpace(int lineSpace)
}
}
int NavButton::getLineWidth() const
{
return this->lineWidth;
}
void NavButton::setLineWidth(int lineWidth)
{
if (this->lineWidth != lineWidth) {
@ -541,6 +501,11 @@ void NavButton::setLineWidth(int lineWidth)
}
}
NavButton::LinePosition NavButton::getLinePosition() const
{
return this->linePosition;
}
void NavButton::setLinePosition(const NavButton::LinePosition &linePosition)
{
if (this->linePosition != linePosition) {
@ -549,6 +514,11 @@ void NavButton::setLinePosition(const NavButton::LinePosition &linePosition)
}
}
QColor NavButton::getLineColor() const
{
return this->lineColor;
}
void NavButton::setLineColor(const QColor &lineColor)
{
if (this->lineColor != lineColor) {
@ -557,6 +527,11 @@ void NavButton::setLineColor(const QColor &lineColor)
}
}
QColor NavButton::getNormalBgColor() const
{
return this->normalBgColor;
}
void NavButton::setNormalBgColor(const QColor &normalBgColor)
{
if (this->normalBgColor != normalBgColor) {
@ -565,6 +540,11 @@ void NavButton::setNormalBgColor(const QColor &normalBgColor)
}
}
QColor NavButton::getHoverBgColor() const
{
return this->hoverBgColor;
}
void NavButton::setHoverBgColor(const QColor &hoverBgColor)
{
if (this->hoverBgColor != hoverBgColor) {
@ -573,6 +553,11 @@ void NavButton::setHoverBgColor(const QColor &hoverBgColor)
}
}
QColor NavButton::getCheckBgColor() const
{
return this->checkBgColor;
}
void NavButton::setCheckBgColor(const QColor &checkBgColor)
{
if (this->checkBgColor != checkBgColor) {
@ -581,6 +566,11 @@ void NavButton::setCheckBgColor(const QColor &checkBgColor)
}
}
QColor NavButton::getNormalTextColor() const
{
return this->normalTextColor;
}
void NavButton::setNormalTextColor(const QColor &normalTextColor)
{
if (this->normalTextColor != normalTextColor) {
@ -589,6 +579,12 @@ void NavButton::setNormalTextColor(const QColor &normalTextColor)
}
}
QColor NavButton::getHoverTextColor() const
{
return this->hoverTextColor;
}
void NavButton::setHoverTextColor(const QColor &hoverTextColor)
{
if (this->hoverTextColor != hoverTextColor) {
@ -597,6 +593,11 @@ void NavButton::setHoverTextColor(const QColor &hoverTextColor)
}
}
QColor NavButton::getCheckTextColor() const
{
return this->checkTextColor;
}
void NavButton::setCheckTextColor(const QColor &checkTextColor)
{
if (this->checkTextColor != checkTextColor) {

View File

@ -110,7 +110,7 @@ private:
bool showTriangle; //显示倒三角
int triangleLen; //倒三角边长
TrianglePosition trianglePosition; //倒三角位置
TrianglePosition trianglePosition;//倒三角位置
QColor triangleColor; //倒三角颜色
bool showIcon; //显示图标
@ -140,97 +140,116 @@ private:
bool hover; //悬停标志位
public:
int getPaddingLeft() const;
int getPaddingRight() const;
int getPaddingTop() const;
int getPaddingBottom() const;
TextAlign getTextAlign() const;
bool getShowTriangle() const;
int getTriangleLen() const;
TrianglePosition getTrianglePosition()const;
QColor getTriangleColor() const;
bool getShowIcon() const;
int getIconSpace() const;
QSize getIconSize() const;
QPixmap getIconNormal() const;
QPixmap getIconHover() const;
QPixmap getIconCheck() const;
bool getShowLine() const;
int getLineSpace() const;
int getLineWidth() const;
LinePosition getLinePosition() const;
QColor getLineColor() const;
QColor getNormalBgColor() const;
QColor getHoverBgColor() const;
QColor getCheckBgColor() const;
QColor getNormalTextColor() const;
QColor getHoverTextColor() const;
QColor getCheckTextColor() const;
//默认尺寸和最小尺寸
QSize sizeHint() const;
QSize minimumSizeHint() const;
public Q_SLOTS:
//设置文字间隔
//获取和设置文字左侧间隔
int getPaddingLeft() const;
void setPaddingLeft(int paddingLeft);
//获取和设置文字左侧间隔
int getPaddingRight() const;
void setPaddingRight(int paddingRight);
//获取和设置文字顶部间隔
int getPaddingTop() const;
void setPaddingTop(int paddingTop);
//获取和设置文字底部间隔
int getPaddingBottom() const;
void setPaddingBottom(int paddingBottom);
//设置边距
void setPadding(int padding);
void setPadding(int paddingLeft, int paddingRight, int paddingTop, int paddingBottom);
//设置文字对齐
//获取和设置文字对齐
TextAlign getTextAlign() const;
void setTextAlign(const TextAlign &textAlign);
//设置显示倒三角
//获取和设置显示倒三角
bool getShowTriangle() const;
void setShowTriangle(bool showTriangle);
//设置倒三角边长
//获取和设置倒三角边长
int getTriangleLen() const;
void setTriangleLen(int triangleLen);
//设置倒三角位置
//获取和设置倒三角位置
TrianglePosition getTrianglePosition() const;
void setTrianglePosition(const TrianglePosition &trianglePosition);
//设置倒三角颜色
//获取和设置倒三角颜色
QColor getTriangleColor() const;
void setTriangleColor(const QColor &triangleColor);
//设置显示图标
//获取和设置显示图标
bool getShowIcon() const;
void setShowIcon(bool showIcon);
//设置图标间隔
//获取和设置图标间隔
int getIconSpace() const;
void setIconSpace(int iconSpace);
//设置图标尺寸
//获取和设置图标尺寸
QSize getIconSize() const;
void setIconSize(const QSize &iconSize);
//设置正常图标
//获取和设置正常图标
QPixmap getIconNormal() const;
void setIconNormal(const QPixmap &iconNormal);
//设置悬停图标
//获取和设置悬停图标
QPixmap getIconHover() const;
void setIconHover(const QPixmap &iconHover);
//设置按下图标
//获取和设置按下图标
QPixmap getIconCheck() const;
void setIconCheck(const QPixmap &iconCheck);
//设置显示线条
//获取和设置显示线条
bool getShowLine() const;
void setShowLine(bool showLine);
//设置线条间隔
//获取和设置线条间隔
int getLineSpace() const;
void setLineSpace(int lineSpace);
//设置线条宽度
//获取和设置线条宽度
int getLineWidth() const;
void setLineWidth(int lineWidth);
//设置线条位置
//获取和设置线条位置
LinePosition getLinePosition() const;
void setLinePosition(const LinePosition &linePosition);
//设置线条颜色
//获取和设置线条颜色
QColor getLineColor() const;
void setLineColor(const QColor &lineColor);
//设置正常背景颜色
//获取和设置正常背景颜色
QColor getNormalBgColor() const;
void setNormalBgColor(const QColor &normalBgColor);
//设置悬停背景颜色
//获取和设置悬停背景颜色
QColor getHoverBgColor() const;
void setHoverBgColor(const QColor &hoverBgColor);
//设置选中背景颜色
//获取和设置选中背景颜色
QColor getCheckBgColor() const;
void setCheckBgColor(const QColor &checkBgColor);
//设置正常文字颜色
//获取和设置正常文字颜色
QColor getNormalTextColor() const;
void setNormalTextColor(const QColor &normalTextColor);
//设置悬停文字颜色
//获取和设置悬停文字颜色
QColor getHoverTextColor() const;
void setHoverTextColor(const QColor &hoverTextColor);
//设置选中文字颜色
//获取和设置选中文字颜色
QColor getCheckTextColor() const;
void setCheckTextColor(const QColor &checkTextColor);
//设置正常背景画刷
@ -239,7 +258,6 @@ public Q_SLOTS:
void setHoverBgBrush(const QBrush &hoverBgBrush);
//设置选中背景画刷
void setCheckBgBrush(const QBrush &checkBgBrush);
};
#endif // NAVBUTTON_H

View File

@ -123,7 +123,7 @@ SaveLog::SaveLog(QObject *parent) : QObject(parent)
SaveLog::~SaveLog()
{
file->close();
this->stop();
}
void SaveLog::openFile(const QString &fileName)

View File

@ -39,6 +39,11 @@ SaveRunTime::SaveRunTime(QObject *parent) : QObject(parent)
connect(timerSave, SIGNAL(timeout()), this, SLOT(saveLog()));
}
SaveRunTime::~SaveRunTime()
{
this->stop();
}
void SaveRunTime::getDiffValue(const QDateTime &startTime, const QDateTime &endTime, int &day, int &hour, int &minute)
{
qint64 sec = startTime.secsTo(endTime);

View File

@ -26,6 +26,7 @@ class SaveRunTime : public QObject
public:
static SaveRunTime *Instance();
explicit SaveRunTime(QObject *parent = 0);
~SaveRunTime();
private:
static QScopedPointer<SaveRunTime> self;

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

View File

@ -44,11 +44,6 @@ void TrayIcon::iconIsActived(QSystemTrayIcon::ActivationReason reason)
}
}
bool TrayIcon::getVisible() const
{
return trayIcon->isVisible();
}
void TrayIcon::setExitDirect(bool exitDirect)
{
if (this->exitDirect != exitDirect) {
@ -93,6 +88,11 @@ void TrayIcon::setToolTip(const QString &tip)
trayIcon->setToolTip(tip);
}
bool TrayIcon::getVisible() const
{
return trayIcon->isVisible();
}
void TrayIcon::setVisible(bool visible)
{
trayIcon->setVisible(visible);

View File

@ -37,16 +37,11 @@ private slots:
void iconIsActived(QSystemTrayIcon::ActivationReason reason);
public:
bool getVisible() const;
public Q_SLOTS:
//设置是否直接退出,如果不是直接退出则发送信号给主界面
void setExitDirect(bool exitDirect);
//设置所属主窗体
void setMainWidget(QWidget *mainWidget);
//显示主窗体
void showMainWidget();
//显示消息
void showMessage(const QString &title, const QString &msg,
@ -56,10 +51,16 @@ public Q_SLOTS:
void setIcon(const QString &strIcon);
//设置提示信息
void setToolTip(const QString &tip);
//设置是否可见
//获取和设置是否可见
bool getVisible() const;
void setVisible(bool visible);
public Q_SLOTS:
//退出所有
void closeAll();
//显示主窗体
void showMainWidget();
Q_SIGNALS:
void trayIconExit();

View File

@ -44,11 +44,6 @@ void TrayIcon::iconIsActived(QSystemTrayIcon::ActivationReason reason)
}
}
bool TrayIcon::getVisible() const
{
return trayIcon->isVisible();
}
void TrayIcon::setExitDirect(bool exitDirect)
{
if (this->exitDirect != exitDirect) {
@ -93,6 +88,11 @@ void TrayIcon::setToolTip(const QString &tip)
trayIcon->setToolTip(tip);
}
bool TrayIcon::getVisible() const
{
return trayIcon->isVisible();
}
void TrayIcon::setVisible(bool visible)
{
trayIcon->setVisible(visible);

View File

@ -37,16 +37,11 @@ private slots:
void iconIsActived(QSystemTrayIcon::ActivationReason reason);
public:
bool getVisible() const;
public Q_SLOTS:
//设置是否直接退出,如果不是直接退出则发送信号给主界面
void setExitDirect(bool exitDirect);
//设置所属主窗体
void setMainWidget(QWidget *mainWidget);
//显示主窗体
void showMainWidget();
//显示消息
void showMessage(const QString &title, const QString &msg,
@ -56,10 +51,16 @@ public Q_SLOTS:
void setIcon(const QString &strIcon);
//设置提示信息
void setToolTip(const QString &tip);
//设置是否可见
//获取和设置是否可见
bool getVisible() const;
void setVisible(bool visible);
public Q_SLOTS:
//退出所有
void closeAll();
//显示主窗体
void showMainWidget();
Q_SIGNALS:
void trayIconExit();

View File

@ -44,36 +44,6 @@ void PanelWidget::resizeEvent(QResizeEvent *)
scrollArea->resize(this->size());
}
int PanelWidget::getMargin() const
{
return this->margin;
}
int PanelWidget::getSpace() const
{
return this->space;
}
bool PanelWidget::getAutoWidth() const
{
return this->autoWidth;
}
bool PanelWidget::getAutoHeight() const
{
return this->autoHeight;
}
int PanelWidget::getColumnCount() const
{
return this->columnCount;
}
QList<QWidget *> PanelWidget::getWidgets() const
{
return this->widgets;
}
QSize PanelWidget::sizeHint() const
{
return QSize(300, 200);
@ -89,6 +59,11 @@ void PanelWidget::setMargin(int left, int top, int right, int bottom)
gridLayout->setContentsMargins(left, top, right, bottom);
}
int PanelWidget::getMargin() const
{
return this->margin;
}
void PanelWidget::setMargin(int margin)
{
if (this->margin != margin) {
@ -96,6 +71,11 @@ void PanelWidget::setMargin(int margin)
}
}
int PanelWidget::getSpace() const
{
return this->space;
}
void PanelWidget::setSpace(int space)
{
if (this->space != space) {
@ -103,6 +83,11 @@ void PanelWidget::setSpace(int space)
}
}
bool PanelWidget::getAutoWidth() const
{
return this->autoWidth;
}
void PanelWidget::setAutoWidth(bool autoWidth)
{
if (this->autoWidth != autoWidth) {
@ -110,6 +95,11 @@ void PanelWidget::setAutoWidth(bool autoWidth)
}
}
bool PanelWidget::getAutoHeight() const
{
return this->autoHeight;
}
void PanelWidget::setAutoHeight(bool autoHeight)
{
if (this->autoHeight != autoHeight) {
@ -117,6 +107,11 @@ void PanelWidget::setAutoHeight(bool autoHeight)
}
}
int PanelWidget::getColumnCount() const
{
return this->columnCount;
}
void PanelWidget::setColumnCount(int columnCount)
{
if (this->columnCount != columnCount) {
@ -124,6 +119,11 @@ void PanelWidget::setColumnCount(int columnCount)
}
}
QList<QWidget *> PanelWidget::getWidgets() const
{
return this->widgets;
}
void PanelWidget::setWidgets(QList<QWidget *> widgets)
{
this->widgets = widgets;

View File

@ -26,6 +26,7 @@ class PanelWidget : public QWidget
{
Q_OBJECT
Q_PROPERTY(int margin READ getMargin WRITE setMargin)
Q_PROPERTY(int space READ getSpace WRITE setSpace)
Q_PROPERTY(bool autoWidth READ getAutoWidth WRITE setAutoWidth)
@ -40,9 +41,9 @@ protected:
private:
QScrollArea *scrollArea; //滚动区域
QWidget *scrollAreaContents; //滚动区域载体
QWidget *scrollAreaContents;//滚动区域载体
QFrame *frame; //放置设备的框架,自动变宽变高
QVBoxLayout *verticalLayout; //设备面板总布局
QVBoxLayout *verticalLayout;//设备面板总布局
QGridLayout *gridLayout; //设备表格布局
QSpacerItem *hSpacer; //横向弹簧
QSpacerItem *vSpacer; //垂直弹簧
@ -56,35 +57,44 @@ private:
QList<QWidget *> widgets; //设备面板对象集合
public:
int getMargin() const;
int getSpace() const;
bool getAutoWidth() const;
bool getAutoHeight() const;
int getColumnCount() const;
QList<QWidget *> getWidgets() const;
//默认尺寸和最小尺寸
QSize sizeHint() const;
QSize minimumSizeHint() const;
public Q_SLOTS:
//设置边距+间距
//设置边距
void setMargin(int left, int top, int right, int bottom);
//获取和设置边距
int getMargin() const;
void setMargin(int margin);
//获取和设置间距
int getSpace() const;
void setSpace(int space);
//设置自动填充宽度+自动填充高度
//获取和设置自动填充宽度
bool getAutoWidth() const;
void setAutoWidth(bool autoWidth);
//获取和设置自自动填充高度
bool getAutoHeight() const;
void setAutoHeight(bool autoHeight);
//设置列数+窗体集合
//获取和设置列数
int getColumnCount() const;
void setColumnCount(int columnCount);
//获取和设置窗体集合
QList<QWidget *> getWidgets() const;
void setWidgets(QList<QWidget *> widgets);
//载入窗体集合+指定位置插入新窗体+移除指定的窗体+清空窗体
//载入窗体集合
void loadWidgets();
//指定位置插入新窗体
void insertWidget(int index, QWidget *widget);
//移除指定的窗体
void removeWidget(QWidget *widget);
//清空窗体
void clearWidgets();
};

BIN
ui/ui.zip

Binary file not shown.

View File

@ -232,121 +232,6 @@ void LunarCalendarItem::drawLunar(QPainter *painter)
painter->restore();
}
bool LunarCalendarItem::getSelect() const
{
return this->select;
}
bool LunarCalendarItem::getShowLunar() const
{
return this->showLunar;
}
QString LunarCalendarItem::getBgImage() const
{
return this->bgImage;
}
LunarCalendarItem::SelectType LunarCalendarItem::getSelectType() const
{
return this->selectType;
}
QDate LunarCalendarItem::getDate() const
{
return this->date;
}
QString LunarCalendarItem::getLunar() const
{
return this->lunar;
}
LunarCalendarItem::DayType LunarCalendarItem::getDayType() const
{
return this->dayType;
}
QColor LunarCalendarItem::getBorderColor() const
{
return this->borderColor;
}
QColor LunarCalendarItem::getWeekColor() const
{
return this->weekColor;
}
QColor LunarCalendarItem::getSuperColor() const
{
return this->superColor;
}
QColor LunarCalendarItem::getLunarColor() const
{
return this->lunarColor;
}
QColor LunarCalendarItem::getCurrentTextColor() const
{
return this->currentTextColor;
}
QColor LunarCalendarItem::getOtherTextColor() const
{
return this->otherTextColor;
}
QColor LunarCalendarItem::getSelectTextColor() const
{
return this->selectTextColor;
}
QColor LunarCalendarItem::getHoverTextColor() const
{
return this->hoverTextColor;
}
QColor LunarCalendarItem::getCurrentLunarColor() const
{
return this->currentLunarColor;
}
QColor LunarCalendarItem::getOtherLunarColor() const
{
return this->otherLunarColor;
}
QColor LunarCalendarItem::getSelectLunarColor() const
{
return this->selectLunarColor;
}
QColor LunarCalendarItem::getHoverLunarColor() const
{
return this->hoverLunarColor;
}
QColor LunarCalendarItem::getCurrentBgColor() const
{
return this->currentBgColor;
}
QColor LunarCalendarItem::getOtherBgColor() const
{
return this->otherBgColor;
}
QColor LunarCalendarItem::getSelectBgColor() const
{
return this->selectBgColor;
}
QColor LunarCalendarItem::getHoverBgColor() const
{
return this->hoverBgColor;
}
QSize LunarCalendarItem::sizeHint() const
{
return QSize(100, 100);
@ -357,6 +242,11 @@ QSize LunarCalendarItem::minimumSizeHint() const
return QSize(20, 20);
}
bool LunarCalendarItem::getSelect() const
{
return this->select;
}
void LunarCalendarItem::setSelect(bool select)
{
if (this->select != select) {
@ -365,6 +255,11 @@ void LunarCalendarItem::setSelect(bool select)
}
}
bool LunarCalendarItem::getShowLunar() const
{
return this->showLunar;
}
void LunarCalendarItem::setShowLunar(bool showLunar)
{
if (this->showLunar != showLunar) {
@ -373,6 +268,11 @@ void LunarCalendarItem::setShowLunar(bool showLunar)
}
}
QString LunarCalendarItem::getBgImage() const
{
return this->bgImage;
}
void LunarCalendarItem::setBgImage(const QString &bgImage)
{
if (this->bgImage != bgImage) {
@ -381,6 +281,11 @@ void LunarCalendarItem::setBgImage(const QString &bgImage)
}
}
LunarCalendarItem::SelectType LunarCalendarItem::getSelectType() const
{
return this->selectType;
}
void LunarCalendarItem::setSelectType(const LunarCalendarItem::SelectType &selectType)
{
if (this->selectType != selectType) {
@ -389,6 +294,11 @@ void LunarCalendarItem::setSelectType(const LunarCalendarItem::SelectType &selec
}
}
QDate LunarCalendarItem::getDate() const
{
return this->date;
}
void LunarCalendarItem::setDate(const QDate &date)
{
if (this->date != date) {
@ -397,6 +307,11 @@ void LunarCalendarItem::setDate(const QDate &date)
}
}
QString LunarCalendarItem::getLunar() const
{
return this->lunar;
}
void LunarCalendarItem::setLunar(const QString &lunar)
{
if (this->lunar != lunar) {
@ -405,6 +320,11 @@ void LunarCalendarItem::setLunar(const QString &lunar)
}
}
LunarCalendarItem::DayType LunarCalendarItem::getDayType() const
{
return this->dayType;
}
void LunarCalendarItem::setDayType(const LunarCalendarItem::DayType &dayType)
{
if (this->dayType != dayType) {
@ -421,6 +341,11 @@ void LunarCalendarItem::setDate(const QDate &date, const QString &lunar, const D
this->update();
}
QColor LunarCalendarItem::getBorderColor() const
{
return this->borderColor;
}
void LunarCalendarItem::setBorderColor(const QColor &borderColor)
{
if (this->borderColor != borderColor) {
@ -429,6 +354,12 @@ void LunarCalendarItem::setBorderColor(const QColor &borderColor)
}
}
QColor LunarCalendarItem::getWeekColor() const
{
return this->weekColor;
}
void LunarCalendarItem::setWeekColor(const QColor &weekColor)
{
if (this->weekColor != weekColor) {
@ -437,6 +368,11 @@ void LunarCalendarItem::setWeekColor(const QColor &weekColor)
}
}
QColor LunarCalendarItem::getSuperColor() const
{
return this->superColor;
}
void LunarCalendarItem::setSuperColor(const QColor &superColor)
{
if (this->superColor != superColor) {
@ -445,6 +381,11 @@ void LunarCalendarItem::setSuperColor(const QColor &superColor)
}
}
QColor LunarCalendarItem::getLunarColor() const
{
return this->lunarColor;
}
void LunarCalendarItem::setLunarColor(const QColor &lunarColor)
{
if (this->lunarColor != lunarColor) {
@ -453,6 +394,11 @@ void LunarCalendarItem::setLunarColor(const QColor &lunarColor)
}
}
QColor LunarCalendarItem::getCurrentTextColor() const
{
return this->currentTextColor;
}
void LunarCalendarItem::setCurrentTextColor(const QColor &currentTextColor)
{
if (this->currentTextColor != currentTextColor) {
@ -461,6 +407,11 @@ void LunarCalendarItem::setCurrentTextColor(const QColor &currentTextColor)
}
}
QColor LunarCalendarItem::getOtherTextColor() const
{
return this->otherTextColor;
}
void LunarCalendarItem::setOtherTextColor(const QColor &otherTextColor)
{
if (this->otherTextColor != otherTextColor) {
@ -469,6 +420,11 @@ void LunarCalendarItem::setOtherTextColor(const QColor &otherTextColor)
}
}
QColor LunarCalendarItem::getSelectTextColor() const
{
return this->selectTextColor;
}
void LunarCalendarItem::setSelectTextColor(const QColor &selectTextColor)
{
if (this->selectTextColor != selectTextColor) {
@ -477,6 +433,11 @@ void LunarCalendarItem::setSelectTextColor(const QColor &selectTextColor)
}
}
QColor LunarCalendarItem::getHoverTextColor() const
{
return this->hoverTextColor;
}
void LunarCalendarItem::setHoverTextColor(const QColor &hoverTextColor)
{
if (this->hoverTextColor != hoverTextColor) {
@ -485,6 +446,11 @@ void LunarCalendarItem::setHoverTextColor(const QColor &hoverTextColor)
}
}
QColor LunarCalendarItem::getCurrentLunarColor() const
{
return this->currentLunarColor;
}
void LunarCalendarItem::setCurrentLunarColor(const QColor &currentLunarColor)
{
if (this->currentLunarColor != currentLunarColor) {
@ -493,6 +459,12 @@ void LunarCalendarItem::setCurrentLunarColor(const QColor &currentLunarColor)
}
}
QColor LunarCalendarItem::getOtherLunarColor() const
{
return this->otherLunarColor;
}
void LunarCalendarItem::setOtherLunarColor(const QColor &otherLunarColor)
{
if (this->otherLunarColor != otherLunarColor) {
@ -501,6 +473,11 @@ void LunarCalendarItem::setOtherLunarColor(const QColor &otherLunarColor)
}
}
QColor LunarCalendarItem::getSelectLunarColor() const
{
return this->selectLunarColor;
}
void LunarCalendarItem::setSelectLunarColor(const QColor &selectLunarColor)
{
if (this->selectLunarColor != selectLunarColor) {
@ -509,6 +486,11 @@ void LunarCalendarItem::setSelectLunarColor(const QColor &selectLunarColor)
}
}
QColor LunarCalendarItem::getHoverLunarColor() const
{
return this->hoverLunarColor;
}
void LunarCalendarItem::setHoverLunarColor(const QColor &hoverLunarColor)
{
if (this->hoverLunarColor != hoverLunarColor) {
@ -517,6 +499,11 @@ void LunarCalendarItem::setHoverLunarColor(const QColor &hoverLunarColor)
}
}
QColor LunarCalendarItem::getCurrentBgColor() const
{
return this->currentBgColor;
}
void LunarCalendarItem::setCurrentBgColor(const QColor &currentBgColor)
{
if (this->currentBgColor != currentBgColor) {
@ -525,6 +512,12 @@ void LunarCalendarItem::setCurrentBgColor(const QColor &currentBgColor)
}
}
QColor LunarCalendarItem::getOtherBgColor() const
{
return this->otherBgColor;
}
void LunarCalendarItem::setOtherBgColor(const QColor &otherBgColor)
{
if (this->otherBgColor != otherBgColor) {
@ -533,6 +526,11 @@ void LunarCalendarItem::setOtherBgColor(const QColor &otherBgColor)
}
}
QColor LunarCalendarItem::getSelectBgColor() const
{
return this->selectBgColor;
}
void LunarCalendarItem::setSelectBgColor(const QColor &selectBgColor)
{
if (this->selectBgColor != selectBgColor) {
@ -541,6 +539,11 @@ void LunarCalendarItem::setSelectBgColor(const QColor &selectBgColor)
}
}
QColor LunarCalendarItem::getHoverBgColor() const
{
return this->hoverBgColor;
}
void LunarCalendarItem::setHoverBgColor(const QColor &hoverBgColor)
{
if (this->hoverBgColor != hoverBgColor) {

View File

@ -107,91 +107,103 @@ private:
QColor hoverBgColor; //悬停日期背景颜色
public:
bool getSelect() const;
bool getShowLunar() const;
QString getBgImage() const;
SelectType getSelectType() const;
QDate getDate() const;
QString getLunar() const;
DayType getDayType() const;
QColor getBorderColor() const;
QColor getWeekColor() const;
QColor getSuperColor() const;
QColor getLunarColor() const;
QColor getCurrentTextColor() const;
QColor getOtherTextColor() const;
QColor getSelectTextColor() const;
QColor getHoverTextColor() const;
QColor getCurrentLunarColor() const;
QColor getOtherLunarColor() const;
QColor getSelectLunarColor() const;
QColor getHoverLunarColor() const;
QColor getCurrentBgColor() const;
QColor getOtherBgColor() const;
QColor getSelectBgColor() const;
QColor getHoverBgColor() const;
//默认尺寸和最小尺寸
QSize sizeHint() const;
QSize minimumSizeHint() const;
public Q_SLOTS:
//设置是否选中
//获取和设置是否选中
bool getSelect() const;
void setSelect(bool select);
//设置是否显示农历信息
//获取和设置是否显示农历信息
bool getShowLunar() const;
void setShowLunar(bool showLunar);
//设置背景图片
//获取和设置背景图片
QString getBgImage() const;
void setBgImage(const QString &bgImage);
//设置选中背景样式
//获取和设置选中背景样式
SelectType getSelectType() const;
void setSelectType(const SelectType &selectType);
//设置日期
//获取和设置日期
QDate getDate() const;
void setDate(const QDate &date);
//设置农历
//获取和设置农历
QString getLunar() const;
void setLunar(const QString &lunar);
//设置类型
//获取和设置类型
DayType getDayType() const;
void setDayType(const DayType &dayType);
//设置日期/农历/类型
void setDate(const QDate &date, const QString &lunar, const DayType &dayType);
//设置边框颜色
//获取和设置边框颜色
QColor getBorderColor() const;
void setBorderColor(const QColor &borderColor);
//设置周末颜色
//获取和设置周末颜色
QColor getWeekColor() const;
void setWeekColor(const QColor &weekColor);
//设置角标颜色
//获取和设置角标颜色
QColor getSuperColor() const;
void setSuperColor(const QColor &superColor);
//设置农历节日颜色
//获取和设置农历节日颜色
QColor getLunarColor() const;
void setLunarColor(const QColor &lunarColor);
//设置当前月文字颜色
//获取和设置当前月文字颜色
QColor getCurrentTextColor() const;
void setCurrentTextColor(const QColor &currentTextColor);
//设置其他月文字颜色
//获取和设置其他月文字颜色
QColor getOtherTextColor() const;
void setOtherTextColor(const QColor &otherTextColor);
//设置选中日期文字颜色
//获取和设置选中日期文字颜色
QColor getSelectTextColor() const;
void setSelectTextColor(const QColor &selectTextColor);
//设置悬停日期文字颜色
//获取和设置悬停日期文字颜色
QColor getHoverTextColor() const;
void setHoverTextColor(const QColor &hoverTextColor);
//设置当前月农历文字颜色
//获取和设置当前月农历文字颜色
QColor getCurrentLunarColor() const;
void setCurrentLunarColor(const QColor &currentLunarColor);
//设置其他月农历文字颜色
//获取和设置其他月农历文字颜色
QColor getOtherLunarColor() const;
void setOtherLunarColor(const QColor &otherLunarColor);
//设置选中日期农历文字颜色
//获取和设置选中日期农历文字颜色
QColor getSelectLunarColor() const;
void setSelectLunarColor(const QColor &selectLunarColor);
//设置悬停日期农历文字颜色
//获取和设置悬停日期农历文字颜色
QColor getHoverLunarColor() const;
void setHoverLunarColor(const QColor &hoverLunarColor);
//设置当前月背景颜色
//获取和设置当前月背景颜色
QColor getCurrentBgColor() const;
void setCurrentBgColor(const QColor &currentBgColor);
//设置其他月背景颜色
//获取和设置其他月背景颜色
QColor getOtherBgColor() const;
void setOtherBgColor(const QColor &otherBgColor);
//设置选中日期背景颜色
//获取和设置选中日期背景颜色
QColor getSelectBgColor() const;
void setSelectBgColor(const QColor &selectBgColor);
//设置悬停日期背景颜色
//获取和设置悬停日期背景颜色
QColor getHoverBgColor() const;
void setHoverBgColor(const QColor &hoverBgColor);
Q_SIGNALS:

View File

@ -183,10 +183,10 @@ void LunarCalendarWidget::initWidget()
//逐个添加日标签
for (int i = 0; i < 42; ++i) {
LunarCalendarItem *lab = new LunarCalendarItem;
connect(lab, SIGNAL(clicked(QDate, LunarCalendarItem::DayType)), this, SLOT(clicked(QDate, LunarCalendarItem::DayType)));
layoutBody->addWidget(lab, i / 7, i % 7);
dayItems.append(lab);
LunarCalendarItem *item = new LunarCalendarItem;
connect(item, SIGNAL(clicked(QDate, LunarCalendarItem::DayType)), this, SLOT(clicked(QDate, LunarCalendarItem::DayType)));
layoutBody->addWidget(item, i / 7, i % 7);
items << item;
}
//主布局
@ -309,7 +309,7 @@ void LunarCalendarWidget::initDate()
QDate date(tempYear, tempMonth, tempDay);
QString lunar = LunarCalendarInfo::Instance()->getLunarDay(tempYear, tempMonth, tempDay);
dayItems.at(index)->setDate(date, lunar, LunarCalendarItem::DayType_MonthPre);
items.at(index)->setDate(date, lunar, LunarCalendarItem::DayType_MonthPre);
}
//纠正12月份后面部分偏差,12月份后面部分是下一年1月份
@ -327,7 +327,7 @@ void LunarCalendarWidget::initDate()
QDate date(tempYear, tempMonth, tempDay);
QString lunar = LunarCalendarInfo::Instance()->getLunarDay(tempYear, tempMonth, tempDay);
dayItems.at(index)->setDate(date, lunar, LunarCalendarItem::DayType_MonthNext);
items.at(index)->setDate(date, lunar, LunarCalendarItem::DayType_MonthNext);
}
//重新置为当前年月
@ -342,9 +342,9 @@ void LunarCalendarWidget::initDate()
QDate date(tempYear, tempMonth, tempDay);
QString lunar = LunarCalendarInfo::Instance()->getLunarDay(tempYear, tempMonth, tempDay);
if (0 == (i % 7) || 6 == (i % 7)) {
dayItems.at(index)->setDate(date, lunar, LunarCalendarItem::DayType_WeekEnd);
items.at(index)->setDate(date, lunar, LunarCalendarItem::DayType_WeekEnd);
} else {
dayItems.at(index)->setDate(date, lunar, LunarCalendarItem::DayType_MonthCurrent);
items.at(index)->setDate(date, lunar, LunarCalendarItem::DayType_MonthCurrent);
}
}
@ -408,7 +408,7 @@ void LunarCalendarWidget::dayChanged(const QDate &date)
index = day + 6;
}
dayItems.at(i)->setSelect(i == index);
items.at(i)->setSelect(i == index);
}
//发送日期单击信号
@ -424,126 +424,6 @@ void LunarCalendarWidget::dateChanged(int year, int month, int day)
initDate();
}
LunarCalendarWidget::CalendarStyle LunarCalendarWidget::getCalendarStyle() const
{
return this->calendarStyle;
}
LunarCalendarWidget::WeekNameFormat LunarCalendarWidget::getWeekNameFormat() const
{
return this->weekNameFormat;
}
QDate LunarCalendarWidget::getDate() const
{
return this->date;
}
QColor LunarCalendarWidget::getWeekTextColor() const
{
return this->weekTextColor;
}
QColor LunarCalendarWidget::getWeekBgColor() const
{
return this->weekBgColor;
}
bool LunarCalendarWidget::getShowLunar() const
{
return this->showLunar;
}
QString LunarCalendarWidget::getBgImage() const
{
return this->bgImage;
}
LunarCalendarWidget::SelectType LunarCalendarWidget::getSelectType() const
{
return this->selectType;
}
QColor LunarCalendarWidget::getBorderColor() const
{
return this->borderColor;
}
QColor LunarCalendarWidget::getWeekColor() const
{
return this->weekColor;
}
QColor LunarCalendarWidget::getSuperColor() const
{
return this->superColor;
}
QColor LunarCalendarWidget::getLunarColor() const
{
return this->lunarColor;
}
QColor LunarCalendarWidget::getCurrentTextColor() const
{
return this->currentTextColor;
}
QColor LunarCalendarWidget::getOtherTextColor() const
{
return this->otherTextColor;
}
QColor LunarCalendarWidget::getSelectTextColor() const
{
return this->selectTextColor;
}
QColor LunarCalendarWidget::getHoverTextColor() const
{
return this->hoverTextColor;
}
QColor LunarCalendarWidget::getCurrentLunarColor() const
{
return this->currentLunarColor;
}
QColor LunarCalendarWidget::getOtherLunarColor() const
{
return this->otherLunarColor;
}
QColor LunarCalendarWidget::getSelectLunarColor() const
{
return this->selectLunarColor;
}
QColor LunarCalendarWidget::getHoverLunarColor() const
{
return this->hoverLunarColor;
}
QColor LunarCalendarWidget::getCurrentBgColor() const
{
return this->currentBgColor;
}
QColor LunarCalendarWidget::getOtherBgColor() const
{
return this->otherBgColor;
}
QColor LunarCalendarWidget::getSelectBgColor() const
{
return this->selectBgColor;
}
QColor LunarCalendarWidget::getHoverBgColor() const
{
return this->hoverBgColor;
}
QSize LunarCalendarWidget::sizeHint() const
{
return QSize(600, 500);
@ -554,6 +434,335 @@ QSize LunarCalendarWidget::minimumSizeHint() const
return QSize(200, 150);
}
LunarCalendarWidget::CalendarStyle LunarCalendarWidget::getCalendarStyle() const
{
return this->calendarStyle;
}
void LunarCalendarWidget::setCalendarStyle(const LunarCalendarWidget::CalendarStyle &calendarStyle)
{
if (this->calendarStyle != calendarStyle) {
this->calendarStyle = calendarStyle;
}
}
LunarCalendarWidget::WeekNameFormat LunarCalendarWidget::getWeekNameFormat() const
{
return this->weekNameFormat;
}
void LunarCalendarWidget::setWeekNameFormat(const LunarCalendarWidget::WeekNameFormat &weekNameFormat)
{
if (this->weekNameFormat != weekNameFormat) {
this->weekNameFormat = weekNameFormat;
QStringList listWeek;
if (weekNameFormat == WeekNameFormat_Short) {
listWeek << "" << "" << "" << "" << "" << "" << "";
} else if (weekNameFormat == WeekNameFormat_Normal) {
listWeek << "周日" << "周一" << "周二" << "周三" << "周四" << "周五" << "周六";
} else if (weekNameFormat == WeekNameFormat_Long) {
listWeek << "星期天" << "星期一" << "星期二" << "星期三" << "星期四" << "星期五" << "星期六";
} else if (weekNameFormat == WeekNameFormat_En) {
listWeek << "Sun" << "Mon" << "Tue" << "Wed" << "Thu" << "Fri" << "Sat";
}
//逐个添加日期文字
for (int i = 0; i < 7; ++i) {
labWeeks.at(i)->setText(listWeek.at(i));
}
}
}
QDate LunarCalendarWidget::getDate() const
{
return this->date;
}
void LunarCalendarWidget::setDate(const QDate &date)
{
if (this->date != date) {
this->date = date;
initDate();
}
}
QColor LunarCalendarWidget::getWeekTextColor() const
{
return this->weekTextColor;
}
void LunarCalendarWidget::setWeekTextColor(const QColor &weekTextColor)
{
if (this->weekTextColor != weekTextColor) {
this->weekTextColor = weekTextColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getWeekBgColor() const
{
return this->weekBgColor;
}
void LunarCalendarWidget::setWeekBgColor(const QColor &weekBgColor)
{
if (this->weekBgColor != weekBgColor) {
this->weekBgColor = weekBgColor;
this->initStyle();
}
}
bool LunarCalendarWidget::getShowLunar() const
{
return this->showLunar;
}
void LunarCalendarWidget::setShowLunar(bool showLunar)
{
if (this->showLunar != showLunar) {
this->showLunar = showLunar;
this->initStyle();
}
}
QString LunarCalendarWidget::getBgImage() const
{
return this->bgImage;
}
void LunarCalendarWidget::setBgImage(const QString &bgImage)
{
if (this->bgImage != bgImage) {
this->bgImage = bgImage;
this->initStyle();
}
}
LunarCalendarWidget::SelectType LunarCalendarWidget::getSelectType() const
{
return this->selectType;
}
void LunarCalendarWidget::setSelectType(const LunarCalendarWidget::SelectType &selectType)
{
if (this->selectType != selectType) {
this->selectType = selectType;
this->initStyle();
}
}
QColor LunarCalendarWidget::getBorderColor() const
{
return this->borderColor;
}
void LunarCalendarWidget::setBorderColor(const QColor &borderColor)
{
if (this->borderColor != borderColor) {
this->borderColor = borderColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getWeekColor() const
{
return this->weekColor;
}
void LunarCalendarWidget::setWeekColor(const QColor &weekColor)
{
if (this->weekColor != weekColor) {
this->weekColor = weekColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getSuperColor() const
{
return this->superColor;
}
void LunarCalendarWidget::setSuperColor(const QColor &superColor)
{
if (this->superColor != superColor) {
this->superColor = superColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getLunarColor() const
{
return this->lunarColor;
}
void LunarCalendarWidget::setLunarColor(const QColor &lunarColor)
{
if (this->lunarColor != lunarColor) {
this->lunarColor = lunarColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getCurrentTextColor() const
{
return this->currentTextColor;
}
void LunarCalendarWidget::setCurrentTextColor(const QColor &currentTextColor)
{
if (this->currentTextColor != currentTextColor) {
this->currentTextColor = currentTextColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getOtherTextColor() const
{
return this->otherTextColor;
}
void LunarCalendarWidget::setOtherTextColor(const QColor &otherTextColor)
{
if (this->otherTextColor != otherTextColor) {
this->otherTextColor = otherTextColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getSelectTextColor() const
{
return this->selectTextColor;
}
void LunarCalendarWidget::setSelectTextColor(const QColor &selectTextColor)
{
if (this->selectTextColor != selectTextColor) {
this->selectTextColor = selectTextColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getHoverTextColor() const
{
return this->hoverTextColor;
}
void LunarCalendarWidget::setHoverTextColor(const QColor &hoverTextColor)
{
if (this->hoverTextColor != hoverTextColor) {
this->hoverTextColor = hoverTextColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getCurrentLunarColor() const
{
return this->currentLunarColor;
}
void LunarCalendarWidget::setCurrentLunarColor(const QColor &currentLunarColor)
{
if (this->currentLunarColor != currentLunarColor) {
this->currentLunarColor = currentLunarColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getOtherLunarColor() const
{
return this->otherLunarColor;
}
void LunarCalendarWidget::setOtherLunarColor(const QColor &otherLunarColor)
{
if (this->otherLunarColor != otherLunarColor) {
this->otherLunarColor = otherLunarColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getSelectLunarColor() const
{
return this->selectLunarColor;
}
void LunarCalendarWidget::setSelectLunarColor(const QColor &selectLunarColor)
{
if (this->selectLunarColor != selectLunarColor) {
this->selectLunarColor = selectLunarColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getHoverLunarColor() const
{
return this->hoverLunarColor;
}
void LunarCalendarWidget::setHoverLunarColor(const QColor &hoverLunarColor)
{
if (this->hoverLunarColor != hoverLunarColor) {
this->hoverLunarColor = hoverLunarColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getCurrentBgColor() const
{
return this->currentBgColor;
}
void LunarCalendarWidget::setCurrentBgColor(const QColor &currentBgColor)
{
if (this->currentBgColor != currentBgColor) {
this->currentBgColor = currentBgColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getOtherBgColor() const
{
return this->otherBgColor;
}
void LunarCalendarWidget::setOtherBgColor(const QColor &otherBgColor)
{
if (this->otherBgColor != otherBgColor) {
this->otherBgColor = otherBgColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getSelectBgColor() const
{
return this->selectBgColor;
}
void LunarCalendarWidget::setSelectBgColor(const QColor &selectBgColor)
{
if (this->selectBgColor != selectBgColor) {
this->selectBgColor = selectBgColor;
this->initStyle();
}
}
QColor LunarCalendarWidget::getHoverBgColor() const
{
return this->hoverBgColor;
}
void LunarCalendarWidget::setHoverBgColor(const QColor &hoverBgColor)
{
if (this->hoverBgColor != hoverBgColor) {
this->hoverBgColor = hoverBgColor;
this->initStyle();
}
}
//显示上一年
void LunarCalendarWidget::showPreviousYear()
{
@ -627,209 +836,3 @@ void LunarCalendarWidget::showToday()
initDate();
dayChanged(date);
}
void LunarCalendarWidget::setCalendarStyle(const LunarCalendarWidget::CalendarStyle &calendarStyle)
{
if (this->calendarStyle != calendarStyle) {
this->calendarStyle = calendarStyle;
}
}
void LunarCalendarWidget::setWeekNameFormat(const LunarCalendarWidget::WeekNameFormat &weekNameFormat)
{
if (this->weekNameFormat != weekNameFormat) {
this->weekNameFormat = weekNameFormat;
QStringList listWeek;
if (weekNameFormat == WeekNameFormat_Short) {
listWeek << "" << "" << "" << "" << "" << "" << "";
} else if (weekNameFormat == WeekNameFormat_Normal) {
listWeek << "周日" << "周一" << "周二" << "周三" << "周四" << "周五" << "周六";
} else if (weekNameFormat == WeekNameFormat_Long) {
listWeek << "星期天" << "星期一" << "星期二" << "星期三" << "星期四" << "星期五" << "星期六";
} else if (weekNameFormat == WeekNameFormat_En) {
listWeek << "Sun" << "Mon" << "Tue" << "Wed" << "Thu" << "Fri" << "Sat";
}
//逐个添加日期文字
for (int i = 0; i < 7; ++i) {
labWeeks.at(i)->setText(listWeek.at(i));
}
}
}
void LunarCalendarWidget::setDate(const QDate &date)
{
if (this->date != date) {
this->date = date;
initDate();
}
}
void LunarCalendarWidget::setWeekTextColor(const QColor &weekTextColor)
{
if (this->weekTextColor != weekTextColor) {
this->weekTextColor = weekTextColor;
initStyle();
}
}
void LunarCalendarWidget::setWeekBgColor(const QColor &weekBgColor)
{
if (this->weekBgColor != weekBgColor) {
this->weekBgColor = weekBgColor;
initStyle();
}
}
void LunarCalendarWidget::setShowLunar(bool showLunar)
{
if (this->showLunar != showLunar) {
this->showLunar = showLunar;
initStyle();
}
}
void LunarCalendarWidget::setBgImage(const QString &bgImage)
{
if (this->bgImage != bgImage) {
this->bgImage = bgImage;
initStyle();
}
}
void LunarCalendarWidget::setSelectType(const LunarCalendarWidget::SelectType &selectType)
{
if (this->selectType != selectType) {
this->selectType = selectType;
initStyle();
}
}
void LunarCalendarWidget::setBorderColor(const QColor &borderColor)
{
if (this->borderColor != borderColor) {
this->borderColor = borderColor;
initStyle();
}
}
void LunarCalendarWidget::setWeekColor(const QColor &weekColor)
{
if (this->weekColor != weekColor) {
this->weekColor = weekColor;
initStyle();
}
}
void LunarCalendarWidget::setSuperColor(const QColor &superColor)
{
if (this->superColor != superColor) {
this->superColor = superColor;
initStyle();
}
}
void LunarCalendarWidget::setLunarColor(const QColor &lunarColor)
{
if (this->lunarColor != lunarColor) {
this->lunarColor = lunarColor;
initStyle();
}
}
void LunarCalendarWidget::setCurrentTextColor(const QColor &currentTextColor)
{
if (this->currentTextColor != currentTextColor) {
this->currentTextColor = currentTextColor;
initStyle();
}
}
void LunarCalendarWidget::setOtherTextColor(const QColor &otherTextColor)
{
if (this->otherTextColor != otherTextColor) {
this->otherTextColor = otherTextColor;
initStyle();
}
}
void LunarCalendarWidget::setSelectTextColor(const QColor &selectTextColor)
{
if (this->selectTextColor != selectTextColor) {
this->selectTextColor = selectTextColor;
initStyle();
}
}
void LunarCalendarWidget::setHoverTextColor(const QColor &hoverTextColor)
{
if (this->hoverTextColor != hoverTextColor) {
this->hoverTextColor = hoverTextColor;
initStyle();
}
}
void LunarCalendarWidget::setCurrentLunarColor(const QColor &currentLunarColor)
{
if (this->currentLunarColor != currentLunarColor) {
this->currentLunarColor = currentLunarColor;
initStyle();
}
}
void LunarCalendarWidget::setOtherLunarColor(const QColor &otherLunarColor)
{
if (this->otherLunarColor != otherLunarColor) {
this->otherLunarColor = otherLunarColor;
initStyle();
}
}
void LunarCalendarWidget::setSelectLunarColor(const QColor &selectLunarColor)
{
if (this->selectLunarColor != selectLunarColor) {
this->selectLunarColor = selectLunarColor;
initStyle();
}
}
void LunarCalendarWidget::setHoverLunarColor(const QColor &hoverLunarColor)
{
if (this->hoverLunarColor != hoverLunarColor) {
this->hoverLunarColor = hoverLunarColor;
initStyle();
}
}
void LunarCalendarWidget::setCurrentBgColor(const QColor &currentBgColor)
{
if (this->currentBgColor != currentBgColor) {
this->currentBgColor = currentBgColor;
initStyle();
}
}
void LunarCalendarWidget::setOtherBgColor(const QColor &otherBgColor)
{
if (this->otherBgColor != otherBgColor) {
this->otherBgColor = otherBgColor;
initStyle();
}
}
void LunarCalendarWidget::setSelectBgColor(const QColor &selectBgColor)
{
if (this->selectBgColor != selectBgColor) {
this->selectBgColor = selectBgColor;
initStyle();
}
}
void LunarCalendarWidget::setHoverBgColor(const QColor &hoverBgColor)
{
if (this->hoverBgColor != hoverBgColor) {
this->hoverBgColor = hoverBgColor;
initStyle();
}
}

View File

@ -95,7 +95,7 @@ private:
QComboBox *cboxYear; //年份下拉框
QComboBox *cboxMonth; //月份下拉框
QList<QLabel *> labWeeks; //顶部星期名称
QList<LunarCalendarItem *> dayItems;//日期元素
QList<LunarCalendarItem *> items;//日期元素
CalendarStyle calendarStyle; //整体样式
WeekNameFormat weekNameFormat; //星期名称格式
@ -139,107 +139,120 @@ private slots:
void dateChanged(int year, int month, int day);
public:
CalendarStyle getCalendarStyle() const;
WeekNameFormat getWeekNameFormat() const;
QDate getDate() const;
QColor getWeekTextColor() const;
QColor getWeekBgColor() const;
bool getShowLunar() const;
QString getBgImage() const;
SelectType getSelectType() const;
QColor getBorderColor() const;
QColor getWeekColor() const;
QColor getSuperColor() const;
QColor getLunarColor() const;
QColor getCurrentTextColor() const;
QColor getOtherTextColor() const;
QColor getSelectTextColor() const;
QColor getHoverTextColor() const;
QColor getCurrentLunarColor() const;
QColor getOtherLunarColor() const;
QColor getSelectLunarColor() const;
QColor getHoverLunarColor() const;
QColor getCurrentBgColor() const;
QColor getOtherBgColor() const;
QColor getSelectBgColor() const;
QColor getHoverBgColor() const;
//默认尺寸和最小尺寸
QSize sizeHint() const;
QSize minimumSizeHint() const;
//获取和设置整体样式
CalendarStyle getCalendarStyle() const;
void setCalendarStyle(const CalendarStyle &calendarStyle);
//获取和设置星期名称格式
WeekNameFormat getWeekNameFormat() const;
void setWeekNameFormat(const WeekNameFormat &weekNameFormat);
//获取和设置日期
QDate getDate() const;
void setDate(const QDate &date);
//获取和设置顶部星期名称文字颜色
QColor getWeekTextColor() const;
void setWeekTextColor(const QColor &weekTextColor);
//获取和设置顶部星期名称文字背景色
QColor getWeekBgColor() const;
void setWeekBgColor(const QColor &weekBgColor);
//获取和设置是否显示农历信息
bool getShowLunar() const;
void setShowLunar(bool showLunar);
//获取和设置背景图片
QString getBgImage() const;
void setBgImage(const QString &bgImage);
//获取和设置选中背景样式
SelectType getSelectType() const;
void setSelectType(const SelectType &selectType);
//获取和设置边框颜色
QColor getBorderColor() const;
void setBorderColor(const QColor &borderColor);
//获取和设置周末颜色
QColor getWeekColor() const;
void setWeekColor(const QColor &weekColor);
//获取和设置角标颜色
QColor getSuperColor() const;
void setSuperColor(const QColor &superColor);
//获取和设置农历节日颜色
QColor getLunarColor() const;
void setLunarColor(const QColor &lunarColor);
//获取和设置当前月文字颜色
QColor getCurrentTextColor() const;
void setCurrentTextColor(const QColor &currentTextColor);
//获取和设置其他月文字颜色
QColor getOtherTextColor() const;
void setOtherTextColor(const QColor &otherTextColor);
//获取和设置选中日期文字颜色
QColor getSelectTextColor() const;
void setSelectTextColor(const QColor &selectTextColor);
//获取和设置悬停日期文字颜色
QColor getHoverTextColor() const;
void setHoverTextColor(const QColor &hoverTextColor);
//获取和设置当前月农历文字颜色
QColor getCurrentLunarColor() const;
void setCurrentLunarColor(const QColor &currentLunarColor);
//获取和设置其他月农历文字颜色
QColor getOtherLunarColor() const;
void setOtherLunarColor(const QColor &otherLunarColor);
//获取和设置选中日期农历文字颜色
QColor getSelectLunarColor() const;
void setSelectLunarColor(const QColor &selectLunarColor);
//获取和设置悬停日期农历文字颜色
QColor getHoverLunarColor() const;
void setHoverLunarColor(const QColor &hoverLunarColor);
//获取和设置当前月背景颜色
QColor getCurrentBgColor() const;
void setCurrentBgColor(const QColor &currentBgColor);
//获取和设置其他月背景颜色
QColor getOtherBgColor() const;
void setOtherBgColor(const QColor &otherBgColor);
//获取和设置选中日期背景颜色
QColor getSelectBgColor() const;
void setSelectBgColor(const QColor &selectBgColor);
//获取和设置悬停日期背景颜色
QColor getHoverBgColor() const;
void setHoverBgColor(const QColor &hoverBgColor);
public Q_SLOTS:
//上一年,下一年
//转到上一年
void showPreviousYear();
//转到下一年
void showNextYear();
//上一月,下一月
//转到上一月
void showPreviousMonth();
//转到下一月
void showNextMonth();
//转到今天
void showToday();
//设置整体样式
void setCalendarStyle(const CalendarStyle &calendarStyle);
//设置星期名称格式
void setWeekNameFormat(const WeekNameFormat &weekNameFormat);
//设置日期
void setDate(const QDate &date);
//设置顶部星期名称文字颜色+背景色
void setWeekTextColor(const QColor &weekTextColor);
void setWeekBgColor(const QColor &weekBgColor);
//设置是否显示农历信息
void setShowLunar(bool showLunar);
//设置背景图片
void setBgImage(const QString &bgImage);
//设置选中背景样式
void setSelectType(const SelectType &selectType);
//设置边框颜色
void setBorderColor(const QColor &borderColor);
//设置周末颜色
void setWeekColor(const QColor &weekColor);
//设置角标颜色
void setSuperColor(const QColor &superColor);
//设置农历节日颜色
void setLunarColor(const QColor &lunarColor);
//设置当前月文字颜色
void setCurrentTextColor(const QColor &currentTextColor);
//设置其他月文字颜色
void setOtherTextColor(const QColor &otherTextColor);
//设置选中日期文字颜色
void setSelectTextColor(const QColor &selectTextColor);
//设置悬停日期文字颜色
void setHoverTextColor(const QColor &hoverTextColor);
//设置当前月农历文字颜色
void setCurrentLunarColor(const QColor &currentLunarColor);
//设置其他月农历文字颜色
void setOtherLunarColor(const QColor &otherLunarColor);
//设置选中日期农历文字颜色
void setSelectLunarColor(const QColor &selectLunarColor);
//设置悬停日期农历文字颜色
void setHoverLunarColor(const QColor &hoverLunarColor);
//设置当前月背景颜色
void setCurrentBgColor(const QColor &currentBgColor);
//设置其他月背景颜色
void setOtherBgColor(const QColor &otherBgColor);
//设置选中日期背景颜色
void setSelectBgColor(const QColor &selectBgColor);
//设置悬停日期背景颜色
void setHoverBgColor(const QColor &hoverBgColor);
Q_SIGNALS:
void clicked(const QDate &date);
void selectionChanged();