How to Tell the MainWindow to use a different .ui file?
-
How can i tell the mainWindow to use a different .ui when the user say... clicks a button?
-
Make a new Widget that uses that .ui file. When the user clicks the button, show your new Widget.
-
[quote author="JKSH" date="1346202833"]Make a new Widget that uses that .ui file. When the user clicks the button, show your new Widget.[/quote]
Wont that create a new window?
-
[quote author="fiendfan1" date="1346203006"]Wont that create a new window?[/quote]Not if you add it to the same window as the original -- I did a project where I used a QStackedWidget that switches between different .ui-based widgets.
But anyway, after some more reading, I realized this is probably an easier approach: http://qt-project.org/doc/qt-4.8/designer-using-a-ui-file.html#run-time-form-processing
-
You can have a look on "QUiLoader Class":http://qt-project.org/doc/qt-4.8/quiloader.html#details