不通过connect函数,实现cpp文件间的数据传送
success.cpp:
QString &SuccessDialog::getId()
{
return m_id;
}
void SuccessDialog::setId(QString str ,bool b)
{
m_id = str;
qDebug() << "b :" << b;
}
void SuccessDialog::printMsg()
{
qDebug() << __FUNCTION__;
qDebug() << "id is :" << getId();
ui->lineEdit->setText(getId());
}
mainwindow.cpp:
sd = new SuccessDialog();
sd->setId(ui->id_LineEdit->text(),ui->radioButton_5->isChecked());