加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
BatchAddMemberWnd.cpp 2.03 KB
一键复制 编辑 原始数据 按行查看 历史
chaocc.wang 提交于 2019-12-24 14:51 . 版本更新
//
// Created by cc on 2019-03-22.
//
#include "BatchAddMemberWnd.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLabel>
#include <QPushButton>
BatchAddMemberWnd::BatchAddMemberWnd(QWidget* parent)
: UShadowDialog(parent, true, true)
{
QFrame* titleFrm = new QFrame(this);
titleFrm->setFixedHeight(50);
titleFrm->setObjectName("titleFrm");
QLabel* titleLabel = new QLabel(tr("批量邀请群成员"), this);
titleLabel->setObjectName("TitleLabel");
auto * titleLay = new QHBoxLayout(titleFrm);
titleLay->setContentsMargins(20, 0, 20, 0);
titleLay->addWidget(titleLabel);
_pEidt = new AddGroupEdit(this);
_pEidt->setObjectName("TextEdit");
_pEidt->setContentsMargins(9, 6, 9, 6);
QPushButton* cancelBtn = new QPushButton(tr("取消"));
QPushButton* okBtn = new QPushButton(tr("确定"));
QFrame* btnFrm = new QFrame(this);
btnFrm->setObjectName("bodyFrm");
auto* btnFLay = new QHBoxLayout(btnFrm);
btnFLay->addItem(new QSpacerItem(10, 10, QSizePolicy::Expanding));
btnFLay->addWidget(cancelBtn);
btnFLay->addWidget(okBtn);
cancelBtn->setObjectName("cancelButton");
okBtn->setObjectName("makeSureButton");
cancelBtn->setFixedSize(72, 32);
okBtn->setFixedSize(72, 32);
QFrame* mainFrm = new QFrame(this);
auto* mainlay = new QVBoxLayout(mainFrm);
mainlay->setMargin(0);
mainlay->setSpacing(0);
mainlay->addWidget(titleFrm);
mainlay->addWidget(_pEidt);
mainlay->addWidget(btnFrm);
auto* lay = new QVBoxLayout(_pCenternWgt);
lay->setMargin(0);
lay->addWidget(mainFrm);
connect(cancelBtn, &QPushButton::clicked, [this](){
this->setVisible(false);
});
connect(okBtn, &QPushButton::clicked, [this](){
QString text = _pEidt->toPlainText();
emit sgBatchAddGroupMember(text);
this->setVisible(false);
});
setMoverAble(true, titleFrm);
setFixedSize(300, 500);
}
BatchAddMemberWnd::~BatchAddMemberWnd() {
}
/**
*
*/
void BatchAddMemberWnd::clear() {
_pEidt->clear();
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化