改进部分代码
|
@ -14,7 +14,7 @@ ButtonDefence::ButtonDefence(QWidget *parent) : QWidget(parent)
|
||||||
buttonStatus = ButtonStatus_Arming;
|
buttonStatus = ButtonStatus_Arming;
|
||||||
|
|
||||||
type = "police";
|
type = "police";
|
||||||
imgName = QString(":/image/btn_defence_disarming_%1.png").arg(type);
|
imgName = QString(":/image/buttondefence/btn_defence_disarming_%1.png").arg(type);
|
||||||
isDark = false;
|
isDark = false;
|
||||||
|
|
||||||
timer = new QTimer(this);
|
timer = new QTimer(this);
|
||||||
|
@ -142,9 +142,9 @@ QSize ButtonDefence::minimumSizeHint() const
|
||||||
void ButtonDefence::checkAlarm()
|
void ButtonDefence::checkAlarm()
|
||||||
{
|
{
|
||||||
if (isDark) {
|
if (isDark) {
|
||||||
imgName = QString(":/image/btn_defence_error_%1.png").arg(type);
|
imgName = QString(":/image/buttondefence/btn_defence_error_%1.png").arg(type);
|
||||||
} else {
|
} else {
|
||||||
imgName = QString(":/image/btn_defence_alarm_%1.png").arg(type);
|
imgName = QString(":/image/buttondefence/btn_defence_alarm_%1.png").arg(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
isDark = !isDark;
|
isDark = !isDark;
|
||||||
|
@ -195,13 +195,13 @@ void ButtonDefence::setButtonStatus(const ButtonDefence::ButtonStatus &buttonSta
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buttonStatus == ButtonStatus_Arming) {
|
if (buttonStatus == ButtonStatus_Arming) {
|
||||||
imgName = QString(":/image/btn_defence_arming_%1.png").arg(type);
|
imgName = QString(":/image/buttondefence/btn_defence_arming_%1.png").arg(type);
|
||||||
} else if (buttonStatus == ButtonStatus_Disarming) {
|
} else if (buttonStatus == ButtonStatus_Disarming) {
|
||||||
imgName = QString(":/image/btn_defence_disarming_%1.png").arg(type);
|
imgName = QString(":/image/buttondefence/btn_defence_disarming_%1.png").arg(type);
|
||||||
} else if (buttonStatus == ButtonStatus_Bypass) {
|
} else if (buttonStatus == ButtonStatus_Bypass) {
|
||||||
imgName = QString(":/image/btn_defence_bypass_%1.png").arg(type);
|
imgName = QString(":/image/buttondefence/btn_defence_bypass_%1.png").arg(type);
|
||||||
} else if (buttonStatus == ButtonStatus_Error) {
|
} else if (buttonStatus == ButtonStatus_Error) {
|
||||||
imgName = QString(":/image/btn_defence_error_%1.png").arg(type);
|
imgName = QString(":/image/buttondefence/btn_defence_error_%1.png").arg(type);
|
||||||
} else if (buttonStatus == ButtonStatus_Alarm) {
|
} else if (buttonStatus == ButtonStatus_Alarm) {
|
||||||
checkAlarm();
|
checkAlarm();
|
||||||
if (!timer->isActive()) {
|
if (!timer->isActive()) {
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
class ButtonDefence;
|
class ButtonDefence;
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui {
|
||||||
{
|
class frmButtonDefence;
|
||||||
class frmButtonDefence;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class frmButtonDefence : public QWidget
|
class frmButtonDefence : public QWidget
|
||||||
|
|
Before Width: | Height: | Size: 912 B |
Before Width: | Height: | Size: 942 B |
Before Width: | Height: | Size: 912 B |
Before Width: | Height: | Size: 880 B |
Before Width: | Height: | Size: 907 B |
Before Width: | Height: | Size: 588 B After Width: | Height: | Size: 588 B |
Before Width: | Height: | Size: 534 B After Width: | Height: | Size: 534 B |
Before Width: | Height: | Size: 953 B After Width: | Height: | Size: 953 B |
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 588 B After Width: | Height: | Size: 588 B |
Before Width: | Height: | Size: 534 B After Width: | Height: | Size: 534 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 588 B After Width: | Height: | Size: 588 B |
Before Width: | Height: | Size: 534 B After Width: | Height: | Size: 534 B |
Before Width: | Height: | Size: 848 B After Width: | Height: | Size: 848 B |
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 588 B After Width: | Height: | Size: 588 B |
Before Width: | Height: | Size: 534 B After Width: | Height: | Size: 534 B |
Before Width: | Height: | Size: 919 B After Width: | Height: | Size: 919 B |
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 588 B After Width: | Height: | Size: 588 B |
Before Width: | Height: | Size: 534 B After Width: | Height: | Size: 534 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 416 B After Width: | Height: | Size: 416 B |
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
@ -1,35 +1,35 @@
|
||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>image/btn_defence_alarm_bubble.png</file>
|
|
||||||
<file>image/btn_defence_alarm_bubble2.png</file>
|
|
||||||
<file>image/btn_defence_alarm_circle.png</file>
|
|
||||||
<file>image/btn_defence_alarm_msg.png</file>
|
|
||||||
<file>image/btn_defence_alarm_msg2.png</file>
|
|
||||||
<file>image/btn_defence_alarm_police.png</file>
|
|
||||||
<file>image/btn_defence_arming_bubble.png</file>
|
|
||||||
<file>image/btn_defence_arming_bubble2.png</file>
|
|
||||||
<file>image/btn_defence_arming_circle.png</file>
|
|
||||||
<file>image/btn_defence_arming_msg.png</file>
|
|
||||||
<file>image/btn_defence_arming_msg2.png</file>
|
|
||||||
<file>image/btn_defence_arming_police.png</file>
|
|
||||||
<file>image/btn_defence_bypass_bubble.png</file>
|
|
||||||
<file>image/btn_defence_bypass_bubble2.png</file>
|
|
||||||
<file>image/btn_defence_bypass_circle.png</file>
|
|
||||||
<file>image/btn_defence_bypass_msg.png</file>
|
|
||||||
<file>image/btn_defence_bypass_msg2.png</file>
|
|
||||||
<file>image/btn_defence_bypass_police.png</file>
|
|
||||||
<file>image/btn_defence_disarming_bubble.png</file>
|
|
||||||
<file>image/btn_defence_disarming_bubble2.png</file>
|
|
||||||
<file>image/btn_defence_disarming_circle.png</file>
|
|
||||||
<file>image/btn_defence_disarming_msg.png</file>
|
|
||||||
<file>image/btn_defence_disarming_msg2.png</file>
|
|
||||||
<file>image/btn_defence_disarming_police.png</file>
|
|
||||||
<file>image/btn_defence_error_bubble.png</file>
|
|
||||||
<file>image/btn_defence_error_bubble2.png</file>
|
|
||||||
<file>image/btn_defence_error_circle.png</file>
|
|
||||||
<file>image/btn_defence_error_msg.png</file>
|
|
||||||
<file>image/btn_defence_error_msg2.png</file>
|
|
||||||
<file>image/btn_defence_error_police.png</file>
|
|
||||||
<file>image/bg_call.jpg</file>
|
<file>image/bg_call.jpg</file>
|
||||||
|
<file>image/buttondefence/btn_defence_alarm_bubble.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_alarm_bubble2.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_alarm_circle.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_alarm_msg.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_alarm_msg2.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_alarm_police.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_arming_bubble.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_arming_bubble2.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_arming_circle.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_arming_msg.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_arming_msg2.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_arming_police.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_bypass_bubble.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_bypass_bubble2.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_bypass_circle.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_bypass_msg.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_bypass_msg2.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_bypass_police.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_disarming_bubble.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_disarming_bubble2.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_disarming_circle.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_disarming_msg.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_disarming_msg2.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_disarming_police.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_error_bubble.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_error_bubble2.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_error_circle.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_error_msg.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_error_msg2.png</file>
|
||||||
|
<file>image/buttondefence/btn_defence_error_police.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
Before Width: | Height: | Size: 228 KiB |
Before Width: | Height: | Size: 229 KiB |
Before Width: | Height: | Size: 227 KiB |
Before Width: | Height: | Size: 226 KiB |
Before Width: | Height: | Size: 226 KiB |
Before Width: | Height: | Size: 226 KiB |
Before Width: | Height: | Size: 229 KiB |
Before Width: | Height: | Size: 229 KiB |
Before Width: | Height: | Size: 228 KiB |
Before Width: | Height: | Size: 228 KiB |
Before Width: | Height: | Size: 224 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 638 B After Width: | Height: | Size: 638 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 696 B After Width: | Height: | Size: 696 B |
|
@ -9,8 +9,8 @@ ImageSwitch::ImageSwitch(QWidget *parent) : QWidget(parent)
|
||||||
isChecked = false;
|
isChecked = false;
|
||||||
buttonStyle = ButtonStyle_2;
|
buttonStyle = ButtonStyle_2;
|
||||||
|
|
||||||
imgOffFile = ":/image/btncheckoff2.png";
|
imgOffFile = ":/image/imageswitch/btncheckoff2.png";
|
||||||
imgOnFile = ":/image/btncheckon2.png";
|
imgOnFile = ":/image/imageswitch/btncheckon2.png";
|
||||||
imgFile = imgOffFile;
|
imgFile = imgOffFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,16 +70,16 @@ void ImageSwitch::setButtonStyle(const ImageSwitch::ButtonStyle &buttonStyle)
|
||||||
this->buttonStyle = buttonStyle;
|
this->buttonStyle = buttonStyle;
|
||||||
|
|
||||||
if (buttonStyle == ButtonStyle_1) {
|
if (buttonStyle == ButtonStyle_1) {
|
||||||
imgOffFile = ":/image/btncheckoff1.png";
|
imgOffFile = ":/image/imageswitch/btncheckoff1.png";
|
||||||
imgOnFile = ":/image/btncheckon1.png";
|
imgOnFile = ":/image/imageswitch/btncheckon1.png";
|
||||||
this->resize(87, 28);
|
this->resize(87, 28);
|
||||||
} else if (buttonStyle == ButtonStyle_2) {
|
} else if (buttonStyle == ButtonStyle_2) {
|
||||||
imgOffFile = ":/image/btncheckoff2.png";
|
imgOffFile = ":/image/imageswitch/btncheckoff2.png";
|
||||||
imgOnFile = ":/image/btncheckon2.png";
|
imgOnFile = ":/image/imageswitch/btncheckon2.png";
|
||||||
this->resize(87, 28);
|
this->resize(87, 28);
|
||||||
} else if (buttonStyle == ButtonStyle_3) {
|
} else if (buttonStyle == ButtonStyle_3) {
|
||||||
imgOffFile = ":/image/btncheckoff3.png";
|
imgOffFile = ":/image/imageswitch/btncheckoff3.png";
|
||||||
imgOnFile = ":/image/btncheckon3.png";
|
imgOnFile = ":/image/imageswitch/btncheckon3.png";
|
||||||
this->resize(96, 38);
|
this->resize(96, 38);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>image/btncheckoff1.png</file>
|
<file>image/imageswitch/btncheckoff1.png</file>
|
||||||
<file>image/btncheckoff2.png</file>
|
<file>image/imageswitch/btncheckoff2.png</file>
|
||||||
<file>image/btncheckoff3.png</file>
|
<file>image/imageswitch/btncheckoff3.png</file>
|
||||||
<file>image/btncheckon1.png</file>
|
<file>image/imageswitch/btncheckon1.png</file>
|
||||||
<file>image/btncheckon2.png</file>
|
<file>image/imageswitch/btncheckon2.png</file>
|
||||||
<file>image/btncheckon3.png</file>
|
<file>image/imageswitch/btncheckon3.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|