PDA

View Full Version : Windows and forms (for a Wizzard)



doczorg
28th January 2010, 08:12
Hello all!
I'm trying to do something, and I can't figure it out... I'm a total newbee, so be patient ;o)
I want to develop a sort of wizzard for the creation of a database object. My main window (menu) only has buttons on it, and when the user selects one button, it opens another window that I want to behave like a wizzard, meaning that I have a next button and I want all my forms to appear in the same window, and when I get to the end (and click 'finish' or something), my window closes and I return to the main window (with my buttons on it).
What I tried is to open a new window A (QMainWindow) when I click on the next button, and then, open a new window B (QWidget) that is a son of A (so it displays it inside). The problem is that it is shown in transparency, I see the contents of window A as a background of my window B, and when I close window B, I return to window A (and I want to return to the menu).
I can't use QWizard because I want to repeat one page as many times as the user wants to
Here is the workflow
A -> next -> B -> next -> B -> next -> B -> Finish -> Back to menu.
What would be the best practice to do this? What kind of windows and what classes/ui do I have to create and how can I make them follow each other?
Thanks a lot for your time
Regards
Neil.

high_flyer
28th January 2010, 08:50
I can't use QWizard because I want to repeat one page as many times as the user wants to
You can still use QWizard.
In the next() slot you can evaluate if the wizard should go to the next page or not and call next() or back() as you need, just like you did in your try, but the whole wizard frameword is there for your to use done by Qt.