1. 假设已有一个QDialog的父窗口, 想弹出的子窗口为自己实现的myDialog : QDialog.

myDialog 设计和平常的QDialog一样,

childDialog : public QDialog

{

     ... ...

    setLayout(mainLayout);

}

 

子窗口的退出用 槽成员函数 done(int);

 

2. 在父窗口中实现子窗口弹出

设定按键信号槽

在槽函数中    

childDialog myDialog;

myDialog.exec();  即可

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-23
  • 2022-12-23
  • 2021-10-07
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案