[SOLVED] GUI Layering and Contents Changed by Button
-
Bismillahirrahmanirrahim,
Hello, I don't know what is the correct keyword for this. I want to create a GUI app which is like GUI on Windows Application Installer such as IDM or another. With same window, if I click Next button, the window still there but the contents change. What is the concept of this? I see similiar concept in graphic design as layering (see Photoshop/GIMP). And how can I implement this into my Qt GUI project? Should I make a frame on top of window and give some code on the button, so if I click the button the content of frame change? Any example or tutorial? Or just simply give me a clue.
!http://malsasa.files.wordpress.com/2013/06/idm1.png(IDM)!
And if it is impossible, can I make many window in one project? I see only one .ui file in my project and I can't add another. In Netbeans, Java, I can make many frames and link frame in button, so it mimics real Windows Application Installer. You can see what I point here: http://malsasa.wordpress.com/2013/02/24/otodidak-versi-1-dirilis/.
Thank you.
-
you setup your window as you like. For the part with the dynamic content you use a "QStackedWidget":http://qt-project.org/doc/qt-4.8/qstackedwidget.html.
When the NEXT-button is clicked you use "QStackedWidget::setCurretnIndex()":http://qt-project.org/doc/qt-4.8/qstackedwidget.html#currentIndex-prop.In addition you can also use a "QStateMachine":http://qt-project.org/doc/qt-4.8/qstatemachine.html for easily handling the transitions from state to state. But ignore this advise for now if you don't know the concept for state machines yet.
-
Also you can use "QWizard":http://qt-project.org/doc/qt-5.0/qtwidgets/qwizard.html
-
indeed...forgot about QWizard class.
This might be the most easiest way to go for you. -
[quote author="raven-worx" date="1370586247"]you setup your window as you like. For the part with the dynamic content you use a "QStackedWidget":http://qt-project.org/doc/qt-4.8/qstackedwidget.html.
When the NEXT-button is clicked you use "QStackedWidget::setCurretnIndex()":http://qt-project.org/doc/qt-4.8/qstackedwidget.html#currentIndex-prop.In addition you can also use a "QStateMachine":http://qt-project.org/doc/qt-4.8/qstatemachine.html for easily handling the transitions from state to state. But ignore this advise for now if you don't know the concept for state machines yet.[/quote]
Okay, I have tried it on my Qt Creator but I don't know what code to write. Any simple example for QStackedWidget usage? I have read some from googling results but I don't understand well.
[quote author="qxoz" date="1370590295"]Also you can use "QWizard":http://qt-project.org/doc/qt-5.0/qtwidgets/qwizard.html[/quote]
And is there any simple example in QWizard? Thank you all!
-
"Class Wizard Example":http://qt-project.org/doc/qt-4.8/dialogs-classwizard.html
"License Wizard Example":http://qt-project.org/doc/qt-4.8/dialogs-licensewizard.html
"Trivial Wizard Example":http://qt-project.org/doc/qt-4.8/dialogs-trivialwizard.html -
Maybe language is the main problem between us, I am not native speaker. But the best part was, my question is SOLVED.
Just use QStackedLayout on a frame, create layers as many as I want on the QStackedLayout object, and change the index (setCurrentIndex) by button. The complete answer was in this thread: http://qt-project.org/forums/viewreply/138890.
Thank you, All.