1.关闭主窗口并退出程序是 QApplication::exit() 2.如果是QDialog,就accept() 或 reject()
在调用窗口中获取相关参数:
void MainWindow::on_pushButton_3_clicked()
{
CustomerArc *Customer = new CustomerArc();
Customer->setModal(true);
int i = Customer->exec();
if (i==QDialog::Rejected )
QMessageBox::about(this,tr("提示信息"),tr("rejected"));
if (i==QDialog::Accepted)
{
Customer->成员变量处理。。。 }
}
void CustomerArc::on_pushButton_2_clicked()
{
this->accept(); //this->close();
}
3.对于所有QWidget:close()