diff --git a/README.md b/README.md index bca693b..584caaa 100644 --- a/README.md +++ b/README.md @@ -24,4 +24,5 @@ | 21 | battery | 电池电量控件 | | 22 | lineeditnext | 文本框回车焦点下移 | | 23 | zhtopy | 汉字转拼音 | -| 24 | qwtdemo | qwt的源码版本,无需插件,直接源码集成到你的项目即可 | \ No newline at end of file +| 24 | qwtdemo | qwt的源码版本,无需插件,直接源码集成到你的项目即可 | +| 25 | buttondefence | 通用按钮地图效果 | \ No newline at end of file diff --git a/buttondefence/buttondefence.cpp b/buttondefence/buttondefence.cpp new file mode 100644 index 0000000..2abc2eb --- /dev/null +++ b/buttondefence/buttondefence.cpp @@ -0,0 +1,213 @@ +#pragma execution_character_set("utf-8") + +#include "buttondefence.h" +#include "qpainter.h" +#include "qevent.h" +#include "qtimer.h" +#include "qdebug.h" + +ButtonDefence::ButtonDefence(QWidget *parent) : QWidget(parent) +{ + canMove = false; + text = "1"; + buttonStyle = ButtonStyle_Police; + buttonStatus = ButtonStatus_Arming; + + type = "police"; + imgName = QString(":/image/btn_defence_disarming_%1.png").arg(type); + isDark = false; + + timer = new QTimer(this); + timer->setInterval(500); + connect(timer, SIGNAL(timeout()), this, SLOT(checkAlarm())); + + this->installEventFilter(this); +} + +ButtonDefence::~ButtonDefence() +{ + if (timer->isActive()) { + timer->stop(); + } +} + +void ButtonDefence::paintEvent(QPaintEvent *) +{ + double width = this->width(); + double height = this->height(); + + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); + + //绘制背景图 + QImage img(imgName); + if (!img.isNull()) { + img = img.scaled(width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + painter.drawImage(0, 0, img); + } + + //计算字体 + QFont font; + font.setPixelSize(height * 0.37); + font.setBold(true); + + //自动计算文字绘制区域,绘制防区号 + QRectF rect = this->rect(); + if (buttonStyle == ButtonStyle_Police) { + double y = (30 * height / 60); + rect = QRectF(0, y, width, height - y); + } else if (buttonStyle == ButtonStyle_Bubble) { + double y = (8 * height / 60); + rect = QRectF(0, 0, width, height - y); + } else if (buttonStyle == ButtonStyle_Bubble2) { + double y = (13 * height / 60); + rect = QRectF(0, 0, width, height - y); + font.setPixelSize(width * 0.33); + } else if (buttonStyle == ButtonStyle_Msg) { + double y = (17 * height / 60); + rect = QRectF(0, 0, width, height - y); + } else if (buttonStyle == ButtonStyle_Msg2) { + double y = (17 * height / 60); + rect = QRectF(0, 0, width, height - y); + } + + //绘制文字标识 + painter.setFont(font); + painter.setPen(Qt::white); + painter.drawText(rect, Qt::AlignCenter, text); +} + +bool ButtonDefence::eventFilter(QObject *watched, QEvent *event) +{ + if (canMove) { + static QPoint lastPoint; + static bool isPressed = false; + + if (event->type() == QEvent::MouseButtonPress) { + QMouseEvent *e = static_cast(event); + if (this->rect().contains(e->pos()) && (e->button() == Qt::LeftButton)) { + lastPoint = e->pos(); + isPressed = true; + } + } else if (event->type() == QEvent::MouseMove && isPressed) { + QMouseEvent *e = static_cast(event); + int dx = e->pos().x() - lastPoint.x(); + int dy = e->pos().y() - lastPoint.y(); + this->move(this->x() + dx, this->y() + dy); + return true; + } else if (event->type() == QEvent::MouseButtonRelease && isPressed) { + isPressed = false; + } + } + + if (event->type() == QEvent::MouseButtonPress) { + emit clicked(); + } else if (event->type() == QEvent::MouseButtonDblClick) { + emit doubleClicked(); + } + + return QWidget::eventFilter(watched, event); +} + +bool ButtonDefence::getCanMove() const +{ + return this->canMove; +} + +QString ButtonDefence::getText() const +{ + return this->text; +} + +ButtonDefence::ButtonStyle ButtonDefence::getButtonStyle() const +{ + return this->buttonStyle; +} + +ButtonDefence::ButtonStatus ButtonDefence::getButtonStatus() const +{ + return this->buttonStatus; +} + +QSize ButtonDefence::sizeHint() const +{ + return QSize(50, 50); +} + +QSize ButtonDefence::minimumSizeHint() const +{ + return QSize(10, 10); +} + +void ButtonDefence::checkAlarm() +{ + if (isDark) { + imgName = QString(":/image/btn_defence_error_%1.png").arg(type); + } else { + imgName = QString(":/image/btn_defence_alarm_%1.png").arg(type); + } + + isDark = !isDark; + this->update(); +} + +void ButtonDefence::setCanMove(bool canMove) +{ + this->canMove = canMove; +} + +void ButtonDefence::setText(const QString &text) +{ + if (this->text != text) { + this->text = text; + this->update(); + } +} + +void ButtonDefence::setButtonStyle(const ButtonDefence::ButtonStyle &buttonStyle) +{ + this->buttonStyle = buttonStyle; + if (buttonStyle == ButtonStyle_Circle) { + type = "circle"; + } else if (buttonStyle == ButtonStyle_Police) { + type = "police"; + } else if (buttonStyle == ButtonStyle_Bubble) { + type = "bubble"; + } else if (buttonStyle == ButtonStyle_Bubble2) { + type = "bubble2"; + } else if (buttonStyle == ButtonStyle_Msg) { + type = "msg"; + } else if (buttonStyle == ButtonStyle_Msg2) { + type = "msg2"; + } else { + type = "circle"; + } + + setButtonStatus(buttonStatus); +} + +void ButtonDefence::setButtonStatus(const ButtonDefence::ButtonStatus &buttonStatus) +{ + this->buttonStatus = buttonStatus; + isDark = false; + if (timer->isActive()) { + timer->stop(); + } + + if (buttonStatus == ButtonStatus_Arming) { + imgName = QString(":/image/btn_defence_arming_%1.png").arg(type); + } else if (buttonStatus == ButtonStatus_Disarming) { + imgName = QString(":/image/btn_defence_disarming_%1.png").arg(type); + } else if (buttonStatus == ButtonStatus_Bypass) { + imgName = QString(":/image/btn_defence_bypass_%1.png").arg(type); + } else if (buttonStatus == ButtonStatus_Error) { + imgName = QString(":/image/btn_defence_error_%1.png").arg(type); + } else if (buttonStatus == ButtonStatus_Alarm) { + checkAlarm(); + if (!timer->isActive()) { + timer->start(); + } + } + + this->update(); +} diff --git a/buttondefence/buttondefence.h b/buttondefence/buttondefence.h new file mode 100644 index 0000000..2f41144 --- /dev/null +++ b/buttondefence/buttondefence.h @@ -0,0 +1,105 @@ +#ifndef BUTTONDEFENCE_H +#define BUTTONDEFENCE_H + +/** + * 防区按钮控件 作者:feiyangqingyun(QQ:517216493) 2018-7-2 + * 1:可设置防区样式 圆形、警察、气泡、气泡2、消息、消息2 + * 2:可设置防区状态 布防、撤防、报警、旁路、故障 + * 3:可设置报警切换 + * 4:可设置显示的防区号 + * 5:可设置是否可鼠标拖动 + * 6:发出单击和双击信号 + */ + +#include + +#ifdef quc +#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) +#include +#else +#include +#endif + +class QDESIGNER_WIDGET_EXPORT ButtonDefence : public QWidget +#else +class ButtonDefence : public QWidget +#endif + +{ + Q_OBJECT + Q_ENUMS(ButtonStyle) + Q_ENUMS(ButtonStatus) + + Q_PROPERTY(bool canMove READ getCanMove WRITE setCanMove) + Q_PROPERTY(QString text READ getText WRITE setText) + + Q_PROPERTY(ButtonStyle buttonStyle READ getButtonStyle WRITE setButtonStyle) + Q_PROPERTY(ButtonStatus buttonStatus READ getButtonStatus WRITE setButtonStatus) + +public: + //防区样式 圆形、警察、气泡、气泡2、消息、消息2 + enum ButtonStyle { + ButtonStyle_Circle = 0, + ButtonStyle_Police = 1, + ButtonStyle_Bubble = 2, + ButtonStyle_Bubble2 = 3, + ButtonStyle_Msg = 4, + ButtonStyle_Msg2 = 5 + }; + + //防区状态 布防、撤防、报警、旁路、故障 + enum ButtonStatus { + ButtonStatus_Arming = 0, + ButtonStatus_Disarming = 1, + ButtonStatus_Alarm = 2, + ButtonStatus_Bypass = 3, + ButtonStatus_Error = 4 + }; + + explicit ButtonDefence(QWidget *parent = 0); + ~ButtonDefence(); + +protected: + void paintEvent(QPaintEvent *); + bool eventFilter(QObject *watched, QEvent *event); + +private: + bool canMove; //是否可移动 + QString text; //显示文字 + ButtonStyle buttonStyle; //防区样式 + ButtonStatus buttonStatus; //防区状态 + + QString type; //图片末尾类型 + QString imgName; //背景图片名称 + bool isDark; //是否加深报警 + QTimer *timer; //报警闪烁定时器 + +private slots: + void checkAlarm(); + +public: + bool getCanMove() const; + QString getText() const; + + ButtonStyle getButtonStyle() const; + ButtonStatus getButtonStatus() const; + + QSize sizeHint() const; + QSize minimumSizeHint() const; + +public Q_SLOTS: + //设置可移动 + void setCanMove(bool canMove); + //设置显示文字 + void setText(const QString &text); + //设置防区样式 + void setButtonStyle(const ButtonStyle &buttonStyle); + //设置防区状态 + void setButtonStatus(const ButtonStatus &buttonStatus); + +Q_SIGNALS: + void clicked(); + void doubleClicked(); +}; + +#endif //BUTTONDEFENCE_H diff --git a/buttondefence/buttondefence.pro b/buttondefence/buttondefence.pro new file mode 100644 index 0000000..c0699cc --- /dev/null +++ b/buttondefence/buttondefence.pro @@ -0,0 +1,25 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2018-07-04T09:39:27 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = buttondefence +TEMPLATE = app +DESTDIR = $$PWD/../bin +CONFIG += warn_off + +SOURCES += main.cpp +SOURCES += frmbuttondefence.cpp +SOURCES += buttondefence.cpp + +HEADERS += frmbuttondefence.h +HEADERS += buttondefence.h + +FORMS += frmbuttondefence.ui + +RESOURCES += main.qrc diff --git a/buttondefence/frmbuttondefence.cpp b/buttondefence/frmbuttondefence.cpp new file mode 100644 index 0000000..03cce01 --- /dev/null +++ b/buttondefence/frmbuttondefence.cpp @@ -0,0 +1,71 @@ +#include "frmbuttondefence.h" +#include "ui_frmbuttondefence.h" +#include "buttondefence.h" +#include "qdebug.h" + +frmButtonDefence::frmButtonDefence(QWidget *parent) : QWidget(parent), ui(new Ui::frmButtonDefence) +{ + ui->setupUi(this); + this->initForm(); +} + +frmButtonDefence::~frmButtonDefence() +{ + delete ui; +} + +void frmButtonDefence::initForm() +{ + //设置背景地图 + ui->labMap->setStyleSheet("border-image:url(:/image/bg_call.jpg);"); + + btn1 = new ButtonDefence(ui->labMap); + btn1->setText("#1"); + btn1->setGeometry(5, 5, 35, 35); + + btn2 = new ButtonDefence(ui->labMap); + btn2->setText("#2"); + btn2->setGeometry(45, 5, 35, 35); + + btn3 = new ButtonDefence(ui->labMap); + btn3->setText("#3"); + btn3->setGeometry(85, 5, 35, 35); + + btnStyle << ui->btnCircle << ui->btnPolice << ui->btnBubble << ui->btnBubble2 << ui->btnMsg << ui->btnMsg2; + foreach (QPushButton *btn, btnStyle) { + connect(btn, SIGNAL(clicked(bool)), this, SLOT(changeStyle())); + } + + btnStatus << ui->btnArming << ui->btnDisarming << ui->btnAlarm << ui->btnBypass << ui->btnError; + foreach (QPushButton *btn, btnStatus) { + connect(btn, SIGNAL(clicked(bool)), this, SLOT(changeStatus())); + } +} + +void frmButtonDefence::changeStyle() +{ + QPushButton *btn = (QPushButton *)sender(); + int index = btnStyle.indexOf(btn); + ButtonDefence::ButtonStyle style = (ButtonDefence::ButtonStyle)index; + btn1->setButtonStyle(style); + btn2->setButtonStyle(style); + btn3->setButtonStyle(style); +} + +void frmButtonDefence::changeStatus() +{ + QPushButton *btn = (QPushButton *)sender(); + int index = btnStatus.indexOf(btn); + ButtonDefence::ButtonStatus style = (ButtonDefence::ButtonStatus)index; + btn1->setButtonStatus(style); + btn2->setButtonStatus(style); + btn3->setButtonStatus(style); +} + +void frmButtonDefence::on_ckCanMove_stateChanged(int arg1) +{ + bool canMove = (arg1 != 0); + btn1->setCanMove(canMove); + btn2->setCanMove(canMove); + btn3->setCanMove(canMove); +} diff --git a/buttondefence/frmbuttondefence.h b/buttondefence/frmbuttondefence.h new file mode 100644 index 0000000..808eb22 --- /dev/null +++ b/buttondefence/frmbuttondefence.h @@ -0,0 +1,37 @@ +#ifndef FRMBUTTONDEFENCE_H +#define FRMBUTTONDEFENCE_H + +#include + +class ButtonDefence; +class QPushButton; + +namespace Ui +{ + class frmButtonDefence; +} + +class frmButtonDefence : public QWidget +{ + Q_OBJECT + +public: + explicit frmButtonDefence(QWidget *parent = 0); + ~frmButtonDefence(); + +private slots: + void initForm(); + void changeStyle(); + void changeStatus(); + void on_ckCanMove_stateChanged(int arg1); + +private: + Ui::frmButtonDefence *ui; + ButtonDefence *btn1; + ButtonDefence *btn2; + ButtonDefence *btn3; + QList btnStyle; + QList btnStatus; +}; + +#endif // FRMBUTTONDEFENCE_H diff --git a/buttondefence/frmbuttondefence.ui b/buttondefence/frmbuttondefence.ui new file mode 100644 index 0000000..5e914fc --- /dev/null +++ b/buttondefence/frmbuttondefence.ui @@ -0,0 +1,160 @@ + + + frmButtonDefence + + + + 0 + 0 + 800 + 500 + + + + Form + + + + + + QFrame::Box + + + QFrame::Sunken + + + + + + Qt::AlignCenter + + + + + + + + 100 + 16777215 + + + + QFrame::Box + + + QFrame::Sunken + + + + + + 圆形 + + + + + + + 警察 + + + + + + + 气泡 + + + + + + + 气泡2 + + + + + + + 消息 + + + + + + + 消息2 + + + + + + + Qt::Horizontal + + + + + + + 布防 + + + + + + + 撤防 + + + + + + + 报警 + + + + + + + 旁路 + + + + + + + 故障 + + + + + + + 可移动 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + diff --git a/buttondefence/image/bg_call.jpg b/buttondefence/image/bg_call.jpg new file mode 100644 index 0000000..480dd16 Binary files /dev/null and b/buttondefence/image/bg_call.jpg differ diff --git a/buttondefence/image/btn_defence_alarm_bubble.png b/buttondefence/image/btn_defence_alarm_bubble.png new file mode 100644 index 0000000..19f36db Binary files /dev/null and b/buttondefence/image/btn_defence_alarm_bubble.png differ diff --git a/buttondefence/image/btn_defence_alarm_bubble2.png b/buttondefence/image/btn_defence_alarm_bubble2.png new file mode 100644 index 0000000..1e1dce2 Binary files /dev/null and b/buttondefence/image/btn_defence_alarm_bubble2.png differ diff --git a/buttondefence/image/btn_defence_alarm_circle.png b/buttondefence/image/btn_defence_alarm_circle.png new file mode 100644 index 0000000..d1216cc Binary files /dev/null and b/buttondefence/image/btn_defence_alarm_circle.png differ diff --git a/buttondefence/image/btn_defence_alarm_msg.png b/buttondefence/image/btn_defence_alarm_msg.png new file mode 100644 index 0000000..d800034 Binary files /dev/null and b/buttondefence/image/btn_defence_alarm_msg.png differ diff --git a/buttondefence/image/btn_defence_alarm_msg2.png b/buttondefence/image/btn_defence_alarm_msg2.png new file mode 100644 index 0000000..991fe5e Binary files /dev/null and b/buttondefence/image/btn_defence_alarm_msg2.png differ diff --git a/buttondefence/image/btn_defence_alarm_police.png b/buttondefence/image/btn_defence_alarm_police.png new file mode 100644 index 0000000..28e624e Binary files /dev/null and b/buttondefence/image/btn_defence_alarm_police.png differ diff --git a/buttondefence/image/btn_defence_arming_bubble.png b/buttondefence/image/btn_defence_arming_bubble.png new file mode 100644 index 0000000..d9d3cda Binary files /dev/null and b/buttondefence/image/btn_defence_arming_bubble.png differ diff --git a/buttondefence/image/btn_defence_arming_bubble2.png b/buttondefence/image/btn_defence_arming_bubble2.png new file mode 100644 index 0000000..0c8951b Binary files /dev/null and b/buttondefence/image/btn_defence_arming_bubble2.png differ diff --git a/buttondefence/image/btn_defence_arming_circle.png b/buttondefence/image/btn_defence_arming_circle.png new file mode 100644 index 0000000..c81334b Binary files /dev/null and b/buttondefence/image/btn_defence_arming_circle.png differ diff --git a/buttondefence/image/btn_defence_arming_msg.png b/buttondefence/image/btn_defence_arming_msg.png new file mode 100644 index 0000000..0375cdc Binary files /dev/null and b/buttondefence/image/btn_defence_arming_msg.png differ diff --git a/buttondefence/image/btn_defence_arming_msg2.png b/buttondefence/image/btn_defence_arming_msg2.png new file mode 100644 index 0000000..dc56f5f Binary files /dev/null and b/buttondefence/image/btn_defence_arming_msg2.png differ diff --git a/buttondefence/image/btn_defence_arming_police.png b/buttondefence/image/btn_defence_arming_police.png new file mode 100644 index 0000000..fecc8dd Binary files /dev/null and b/buttondefence/image/btn_defence_arming_police.png differ diff --git a/buttondefence/image/btn_defence_bypass_bubble.png b/buttondefence/image/btn_defence_bypass_bubble.png new file mode 100644 index 0000000..8491876 Binary files /dev/null and b/buttondefence/image/btn_defence_bypass_bubble.png differ diff --git a/buttondefence/image/btn_defence_bypass_bubble2.png b/buttondefence/image/btn_defence_bypass_bubble2.png new file mode 100644 index 0000000..ba01c52 Binary files /dev/null and b/buttondefence/image/btn_defence_bypass_bubble2.png differ diff --git a/buttondefence/image/btn_defence_bypass_circle.png b/buttondefence/image/btn_defence_bypass_circle.png new file mode 100644 index 0000000..cb971aa Binary files /dev/null and b/buttondefence/image/btn_defence_bypass_circle.png differ diff --git a/buttondefence/image/btn_defence_bypass_msg.png b/buttondefence/image/btn_defence_bypass_msg.png new file mode 100644 index 0000000..5b973b5 Binary files /dev/null and b/buttondefence/image/btn_defence_bypass_msg.png differ diff --git a/buttondefence/image/btn_defence_bypass_msg2.png b/buttondefence/image/btn_defence_bypass_msg2.png new file mode 100644 index 0000000..f27ec02 Binary files /dev/null and b/buttondefence/image/btn_defence_bypass_msg2.png differ diff --git a/buttondefence/image/btn_defence_bypass_police.png b/buttondefence/image/btn_defence_bypass_police.png new file mode 100644 index 0000000..069c5e7 Binary files /dev/null and b/buttondefence/image/btn_defence_bypass_police.png differ diff --git a/buttondefence/image/btn_defence_disarming_bubble.png b/buttondefence/image/btn_defence_disarming_bubble.png new file mode 100644 index 0000000..ebd4c8e Binary files /dev/null and b/buttondefence/image/btn_defence_disarming_bubble.png differ diff --git a/buttondefence/image/btn_defence_disarming_bubble2.png b/buttondefence/image/btn_defence_disarming_bubble2.png new file mode 100644 index 0000000..1b2a5aa Binary files /dev/null and b/buttondefence/image/btn_defence_disarming_bubble2.png differ diff --git a/buttondefence/image/btn_defence_disarming_circle.png b/buttondefence/image/btn_defence_disarming_circle.png new file mode 100644 index 0000000..b36931f Binary files /dev/null and b/buttondefence/image/btn_defence_disarming_circle.png differ diff --git a/buttondefence/image/btn_defence_disarming_msg.png b/buttondefence/image/btn_defence_disarming_msg.png new file mode 100644 index 0000000..99b3703 Binary files /dev/null and b/buttondefence/image/btn_defence_disarming_msg.png differ diff --git a/buttondefence/image/btn_defence_disarming_msg2.png b/buttondefence/image/btn_defence_disarming_msg2.png new file mode 100644 index 0000000..6774c8a Binary files /dev/null and b/buttondefence/image/btn_defence_disarming_msg2.png differ diff --git a/buttondefence/image/btn_defence_disarming_police.png b/buttondefence/image/btn_defence_disarming_police.png new file mode 100644 index 0000000..52ef298 Binary files /dev/null and b/buttondefence/image/btn_defence_disarming_police.png differ diff --git a/buttondefence/image/btn_defence_error_bubble.png b/buttondefence/image/btn_defence_error_bubble.png new file mode 100644 index 0000000..2ab6431 Binary files /dev/null and b/buttondefence/image/btn_defence_error_bubble.png differ diff --git a/buttondefence/image/btn_defence_error_bubble2.png b/buttondefence/image/btn_defence_error_bubble2.png new file mode 100644 index 0000000..cefa46c Binary files /dev/null and b/buttondefence/image/btn_defence_error_bubble2.png differ diff --git a/buttondefence/image/btn_defence_error_circle.png b/buttondefence/image/btn_defence_error_circle.png new file mode 100644 index 0000000..b3fc4ff Binary files /dev/null and b/buttondefence/image/btn_defence_error_circle.png differ diff --git a/buttondefence/image/btn_defence_error_msg.png b/buttondefence/image/btn_defence_error_msg.png new file mode 100644 index 0000000..f83642d Binary files /dev/null and b/buttondefence/image/btn_defence_error_msg.png differ diff --git a/buttondefence/image/btn_defence_error_msg2.png b/buttondefence/image/btn_defence_error_msg2.png new file mode 100644 index 0000000..2705b7c Binary files /dev/null and b/buttondefence/image/btn_defence_error_msg2.png differ diff --git a/buttondefence/image/btn_defence_error_police.png b/buttondefence/image/btn_defence_error_police.png new file mode 100644 index 0000000..9560244 Binary files /dev/null and b/buttondefence/image/btn_defence_error_police.png differ diff --git a/buttondefence/main.cpp b/buttondefence/main.cpp new file mode 100644 index 0000000..b0b2855 --- /dev/null +++ b/buttondefence/main.cpp @@ -0,0 +1,31 @@ +#pragma execution_character_set("utf-8") + +#include "frmbuttondefence.h" +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + a.setFont(QFont("Microsoft Yahei", 9)); + +#if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) +#if _MSC_VER + QTextCodec *codec = QTextCodec::codecForName("gbk"); +#else + QTextCodec *codec = QTextCodec::codecForName("utf-8"); +#endif + QTextCodec::setCodecForLocale(codec); + QTextCodec::setCodecForCStrings(codec); + QTextCodec::setCodecForTr(codec); +#else + QTextCodec *codec = QTextCodec::codecForName("utf-8"); + QTextCodec::setCodecForLocale(codec); +#endif + + frmButtonDefence w; + w.setWindowTitle("防区按钮控件"); + w.show(); + + return a.exec(); +} diff --git a/buttondefence/main.qrc b/buttondefence/main.qrc new file mode 100644 index 0000000..562ef7e --- /dev/null +++ b/buttondefence/main.qrc @@ -0,0 +1,35 @@ + + + image/btn_defence_alarm_bubble.png + image/btn_defence_alarm_bubble2.png + image/btn_defence_alarm_circle.png + image/btn_defence_alarm_msg.png + image/btn_defence_alarm_msg2.png + image/btn_defence_alarm_police.png + image/btn_defence_arming_bubble.png + image/btn_defence_arming_bubble2.png + image/btn_defence_arming_circle.png + image/btn_defence_arming_msg.png + image/btn_defence_arming_msg2.png + image/btn_defence_arming_police.png + image/btn_defence_bypass_bubble.png + image/btn_defence_bypass_bubble2.png + image/btn_defence_bypass_circle.png + image/btn_defence_bypass_msg.png + image/btn_defence_bypass_msg2.png + image/btn_defence_bypass_police.png + image/btn_defence_disarming_bubble.png + image/btn_defence_disarming_bubble2.png + image/btn_defence_disarming_circle.png + image/btn_defence_disarming_msg.png + image/btn_defence_disarming_msg2.png + image/btn_defence_disarming_police.png + image/btn_defence_error_bubble.png + image/btn_defence_error_bubble2.png + image/btn_defence_error_circle.png + image/btn_defence_error_msg.png + image/btn_defence_error_msg2.png + image/btn_defence_error_police.png + image/bg_call.jpg + + diff --git a/buttondefence/snap/QQ截图20180704101942.JPG b/buttondefence/snap/QQ截图20180704101942.JPG new file mode 100644 index 0000000..96dffad Binary files /dev/null and b/buttondefence/snap/QQ截图20180704101942.JPG differ diff --git a/buttondefence/snap/QQ截图20180704101947.JPG b/buttondefence/snap/QQ截图20180704101947.JPG new file mode 100644 index 0000000..ea7ab83 Binary files /dev/null and b/buttondefence/snap/QQ截图20180704101947.JPG differ diff --git a/buttondefence/snap/QQ截图20180704101953.JPG b/buttondefence/snap/QQ截图20180704101953.JPG new file mode 100644 index 0000000..1726780 Binary files /dev/null and b/buttondefence/snap/QQ截图20180704101953.JPG differ diff --git a/buttondefence/snap/QQ截图20180704101956.JPG b/buttondefence/snap/QQ截图20180704101956.JPG new file mode 100644 index 0000000..0dfb786 Binary files /dev/null and b/buttondefence/snap/QQ截图20180704101956.JPG differ diff --git a/buttondefence/snap/QQ截图20180704102000.JPG b/buttondefence/snap/QQ截图20180704102000.JPG new file mode 100644 index 0000000..e07bcd0 Binary files /dev/null and b/buttondefence/snap/QQ截图20180704102000.JPG differ diff --git a/buttondefence/snap/QQ截图20180704102003.JPG b/buttondefence/snap/QQ截图20180704102003.JPG new file mode 100644 index 0000000..1b195e1 Binary files /dev/null and b/buttondefence/snap/QQ截图20180704102003.JPG differ diff --git a/buttondefence/snap/QQ截图20180704102029.JPG b/buttondefence/snap/QQ截图20180704102029.JPG new file mode 100644 index 0000000..ccc88be Binary files /dev/null and b/buttondefence/snap/QQ截图20180704102029.JPG differ diff --git a/buttondefence/snap/QQ截图20180704102034.JPG b/buttondefence/snap/QQ截图20180704102034.JPG new file mode 100644 index 0000000..d877007 Binary files /dev/null and b/buttondefence/snap/QQ截图20180704102034.JPG differ diff --git a/buttondefence/snap/QQ截图20180704102037.JPG b/buttondefence/snap/QQ截图20180704102037.JPG new file mode 100644 index 0000000..9ae0f5b Binary files /dev/null and b/buttondefence/snap/QQ截图20180704102037.JPG differ diff --git a/buttondefence/snap/QQ截图20180704102040.JPG b/buttondefence/snap/QQ截图20180704102040.JPG new file mode 100644 index 0000000..7ce6657 Binary files /dev/null and b/buttondefence/snap/QQ截图20180704102040.JPG differ diff --git a/buttondefence/snap/QQ截图20180704102108.JPG b/buttondefence/snap/QQ截图20180704102108.JPG new file mode 100644 index 0000000..08857cf Binary files /dev/null and b/buttondefence/snap/QQ截图20180704102108.JPG differ