請問QT編程中如何實現(xiàn)子窗口返回主窗口?
發(fā)表于2019-05-10
回復(fù):0
查看:7769 |
假如主窗口為MainWindow 子窗口為SecondWindow 在mainwindow.cpp中使用this->close();
sw.show();可以實現(xiàn)彈出第二個窗口 但是如何返回呢?
在secondwindow.cpp中可以this->close();但如何再次show出MainWindow啊?現(xiàn)在使用
<pre class='brush: csharp'> this->close();
sw->show();
sw->exec();
this->show();</pre>
可以實現(xiàn)這個效果 但是程序相當(dāng)于一直在關(guān)閉和打開的狀態(tài)中跳轉(zhuǎn) 能看到狀態(tài)欄中點一下閃一下
所以想問問不用這個方法怎么辦
登錄 慧都網(wǎng)發(fā)表評論