Qt多窗口来回切换实战

https://blog.csdn.net/Stephen_jie/article/details/52926607

mainwindow  主窗口    dialog1  1级窗口。 dialog2  2级窗口

关键代码:

mainwindow  主窗口 点击按钮  dialog1 出现。在dialog1中按返回键返回 mainwindow

    this->hide();   
    dialog1->show();    
    dialog1->exec();
     this->show();

dialog1  1级窗口  点击按钮  dialog2出现。在dialog2中按返回键返回dialog1.
   
   dialog2->show();
    dialog2->exec();

区别在于第一级 多2条    this->hide();    this->show();

发布了115 篇原创文章 · 获赞 20 · 访问量 36万+

猜你喜欢

转载自blog.csdn.net/u014683488/article/details/103841815