You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wheeldetect/src/tpMain/qaddchanneldlg.cpp

47 lines
1.1 KiB
C++

#include "qaddchanneldlg.h"
#include <QMessageBox>
#pragma execution_character_set("utf-8")
QAddChannelDlg::QAddChannelDlg(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);
connect(ui.pushButton_Cancle,SIGNAL(clicked()),this,SLOT(SlotFunc()));
connect(ui.pushButton_OK, SIGNAL(clicked()), this, SLOT(SlotFunc()));
setWindowIcon(QIcon(":/image/leaper"));
setWindowFlags(Qt::WindowCloseButtonHint);
}
QAddChannelDlg::~QAddChannelDlg()
{
}
QString QAddChannelDlg::GetData(QString &Channelname,int &m_value)
{
Channelname = this->m_Channelname;
m_value = this->m_value;
return this->m_AboutName;
}
Q_SLOT void QAddChannelDlg::SlotFunc()
{
QWidget *pWdgt = (QWidget*)sender();
QString strname = pWdgt->objectName();
if (strname == "pushButton_OK")
{
m_Channelname = ui.lineEdit_name->text();
m_value = ui.spinBox_value->value();
m_AboutName = ui.lineEdit_About->text();
if (m_Channelname.isEmpty())
{
QMessageBox::warning(this, tr("警告"), tr("数据不能为空,请输入"), QMessageBox::Yes);
return;
}
QDialog::accept();
}
else if (strname == "pushButton_Cancle")
{
QDialog::close();
}
}