kylin-nm/plugins/netconnect/itemframe.cpp

48 lines
1.3 KiB
C++
Raw Permalink Normal View History

2022-06-02 16:27:45 +08:00
#include "itemframe.h"
#include <QPainter>
#include <QPalette>
#define LAYOUT_MARGINS 0,0,0,0
#define MAIN_LAYOUT_MARGINS 0,0,0,0
ItemFrame::ItemFrame(QString devName, QWidget *parent) : QFrame(parent)
{
deviceLanLayout = new QVBoxLayout(this);
deviceLanLayout->setContentsMargins(MAIN_LAYOUT_MARGINS);
lanItemFrame = new QFrame(this);
lanItemFrame->setFrameShape(QFrame::Shape::NoFrame);
lanItemLayout = new QVBoxLayout(this);
lanItemLayout->setContentsMargins(LAYOUT_MARGINS);
lanItemLayout->setSpacing(1);
2022-06-17 18:48:59 +08:00
addLanWidget = new AddNetBtn(false, this);
2022-06-02 16:27:45 +08:00
deviceLanLayout->setSpacing(1);
setLayout(deviceLanLayout);
lanItemFrame->setLayout(lanItemLayout);
deviceFrame = new DeviceFrame(devName, this);
deviceLanLayout->addWidget(deviceFrame);
deviceLanLayout->addWidget(lanItemFrame);
deviceLanLayout->addWidget(addLanWidget);
//下拉按钮
connect(deviceFrame->dropDownLabel, &DrownLabel::labelClicked, this, &ItemFrame::onDrownLabelClicked);
}
ItemFrame::~ItemFrame()
{
}
void ItemFrame::onDrownLabelClicked()
{
if (!deviceFrame->dropDownLabel->isChecked) {
lanItemFrame->show();
deviceFrame->dropDownLabel->setDropDownStatus(true);
} else {
lanItemFrame->hide();
deviceFrame->dropDownLabel->setDropDownStatus(false);
}
}