Reputation: 523
I have some QWidget class which ui files are separate from QMainWindow ui file.
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 ?
Upvotes: 1
Views: 1112
Reputation: 3852
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.
If this is correct, you might want to look at QStackedLayout.
Upvotes: 4
Reputation: 2017
Add your widget headers (note that you have to generate the headers from ui and inherit) into promoted widgets in your QMainWindow.ui.
Then, You just have to insert a QWidget,QFrame, ... depending on the base class of your widget, and right click on it and select your custom widget from Promote to.. Submenu.
Upvotes: 1