123456789101112131415161718192021222324252627282930313233343536373839 |
- #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");
- }
- Widget::~Widget()
- {
- if(m_tSwitch != nullptr)
- {
- delete m_tSwitch;
- m_tSwitch = nullptr;
- }
- if(m_layout != nullptr)
- {
- delete m_layout;
- m_layout = nullptr;
- }
- delete ui;
- }
|