123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #include "widget.h"
- #include "ui_widget.h"
- #include "LHQLogAPI.h"
- Widget::Widget(QWidget *parent) :
- QWidget(parent),
- ui(new Ui::Widget)
- {
- ui->setupUi(this);
- m_tSwitch = new TransmitterSwitch(this);
- /* 设置一个布局 */
- m_layout = new QVBoxLayout(this);
- m_layout->addWidget(m_tSwitch);
- setLayout(m_layout);
- /* 设置边距为0 */
- m_layout->setMargin(20);
- m_layout->setSpacing(0);
- /* 设置参数 */
- m_tSwitch->setQSS(":/QSS/QSS/TransmitterSwitch_dark.qss");
- /* 初始化WebAPI */
- m_tSwitch->setWebAPIInfo("http://192.1.3.133:31000/v6/", "2e36b53ccd2a433b9a803b98d683ed91", "TMS");
- }
- Widget::~Widget()
- {
- if(m_tSwitch != nullptr)
- {
- delete m_tSwitch;
- m_tSwitch = nullptr;
- }
- if(m_layout != nullptr)
- {
- delete m_layout;
- m_layout = nullptr;
- }
- delete ui;
- }
|