Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] GUI Layering and Contents Changed by Button

[SOLVED] GUI Layering and Contents Changed by Button

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 4.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ade Malsasa Akbar
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      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.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qxoz
        wrote on last edited by
        #3

        Also you can use "QWizard":http://qt-project.org/doc/qt-5.0/qtwidgets/qwizard.html

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          indeed...forgot about QWizard class.
          This might be the most easiest way to go for you.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Ade Malsasa Akbar
            wrote on last edited by
            #5

            [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!

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              qxoz
              wrote on last edited by
              #6

              "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

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Ade Malsasa Akbar
                wrote on last edited by
                #7

                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.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved