更新文档

This commit is contained in:
feiyangqingyun
2023-09-08 13:52:30 +08:00
parent 9af16093a2
commit 8173abef29
39 changed files with 1556 additions and 1464 deletions

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

@@ -55,78 +55,84 @@ protected:
void drawOverlay(QPainter *painter);
private:
QString text; //文本
QColor textColor; //文字颜色
QColor alarmColor; //报警颜色
QColor normalColor; //正常颜色
QString text; //文本
QColor textColor; //文字颜色
QColor alarmColor; //报警颜色
QColor normalColor; //正常颜色
QColor borderOutColorStart; //外边框渐变开始颜色
QColor borderOutColorEnd; //外边框渐变结束颜色
QColor borderInColorStart; //里边框渐变开始颜色
QColor borderInColorEnd; //里边框渐变结束颜色
QColor bgColor; //背景颜色
QColor borderOutColorStart; //外边框渐变开始颜色
QColor borderOutColorEnd; //外边框渐变结束颜色
QColor borderInColorStart; //里边框渐变开始颜色
QColor borderInColorEnd; //里边框渐变结束颜色
QColor bgColor; //背景颜色
bool showRect; //显示成矩形
bool canMove; //是否能够移动
bool showOverlay; //是否显示遮罩层
QColor overlayColor; //遮罩层颜色
bool showRect; //显示成矩形
bool canMove; //是否能够移动
bool showOverlay; //是否显示遮罩层
QColor overlayColor; //遮罩层颜色
bool pressed; //鼠标是否按下
QPoint lastPoint; //鼠标最后按下坐标
bool pressed; //鼠标是否按下
QPoint lastPoint; //鼠标最后按下坐标
bool isAlarm; //是否报警
QTimer *timerAlarm; //定时器切换颜色
bool isAlarm; //是否报警
QTimer *timerAlarm; //定时器切换颜色
public:
QString getText() const;
QColor getTextColor() const;
QColor getAlarmColor() const;
QColor getNormalColor() const;
//默认尺寸和最小尺寸
QSize sizeHint() const;
QSize minimumSizeHint() 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();
//设置为淡红色