1

I want to create an application whose content of the window will change based on some events. E.g. I have created different .ui files for different content:

a.ui

b.ui

c.ui

After some time (or after some user action) I want to load b.ui into same window. Any idea how to do this?

(I tried to close one window and launch another. But if the user drags one then pushes 'Next' Button it will not open at same location.)

4

2 回答 2

2

Maybe QStackedWidget is what you're looking for, it manages several widgets on top of each-other for you, showing only one at a time. Think of it as a tab widget without showing the tabs.

edit: seeing the "Next" in your post the QWizard answer is probably what you're looking for though.

于 2012-09-04T21:54:20.643 回答
1

I'd use a QWizard for that. I suppose it is the quickest way to go.

EDIT: To be more precise, the answer to your question would be to use the QUiLoader class, to load the ui files you created at runtime. Which is exactly what you asked.

于 2012-09-04T18:24:37.240 回答