将当前QWidget替换为QMainWindow中的另一个QWidget [英] Replace current QWidget to another QWidget in QMainWindow
本文介绍了将当前QWidget替换为QMainWindow中的另一个QWidget的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一些QWidget类的ui文件是独立于QMainWindow ui文件。
I have some QWidget class which ui files are separate from QMainWindow ui file.
如何添加或替换当前QWidet粘贴到QMainWindow到其他QWidget从不同类和ui文件在同一个QMainWindow?
how to add or replace current QWidet which is glued to QMainWindow into other QWidget from different class and ui files on the same QMainWindow ?
推荐答案
如果我正确理解,你正在显示一个小部件, ,您想要隐藏该小部件,并在其位置显示另一个。
If I understand you correctly, you are currently displaying one widget and upon an action, you want to hide that widget and display another one in its place.
如果这是正确的,您可能需要查看 QStackedLayout 。
If this is correct, you might want to look at QStackedLayout.
这篇关于将当前QWidget替换为QMainWindow中的另一个QWidget的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文