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()

 

相关文章:

  • 2022-12-23
  • 2021-07-25
  • 2022-02-27
  • 2022-12-23
  • 2021-12-19
  • 2021-12-23
  • 2021-12-23
猜你喜欢
  • 2021-06-04
  • 2021-12-11
  • 2021-08-16
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案