How to switch forms?
-
i'm new to QT development.
i'm trying to write a multi-form application that will run on linux/android system.so, i read through the documentation, and am able to get a 'hello world' app running on my android box.
then, put a few buttons/labels/displays on the main form. figure out how to hook up event handlers with the buttons.
now, i make a second form.
i want to be able to push the button and bring up the second form. (and more forms as my app progresses).
can anyone tell me how to do this?thanks!
-
okay, so i did this in my event handler:
Screen1 *screen1 = new Screen1();
screen1->show();Screen1 is of course my other form. this works, except that the new form pops up like a dialog, leaving the original screen running. that's closer, but not quite what i want to do. what i want to do is replace the original ui, along with all it's controls & code.
-
hiding the main window probably isn't quite what i wanted to do.
i want to be able to start the app with a home screen, then click a button and go to another screen. the second(and subsequent) screens will have their own controls, event handlers, etc. i then want to be able to switch to other screens, as well as return to the 'home' screen.
i'll take a look at QStackedWidget, that sounds like it might be closer to what i wish to do.
thanks for input, i'll report back what i discover here.