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. QWizard - Dynamic Start Page

QWizard - Dynamic Start Page

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 586 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.
  • M Offline
    M Offline
    Marc Peters
    wrote on last edited by
    #1

    I am working on creating a login wizard which has the following pages:

    1. Welcome Page
    2. Set Locale Page
    3. Choose Options Page
    4. etc.

    When the wizard is initialized, a check is performed to see if a configuration file exists. This file will contain the previously set locale, so I would like to start at page 3 if this is the case. If no file exists, it will start at page 1. The issue with setting the startId to page 3 is that the QWizard will not allow a user to go back if they wanted to change their locale.

    Is there any way to set the start page to page 3 and allow the user to go back if desired? Or is this going to need to be changed to a QStackedWidget with its own start/previous/next logic built?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      From the top of my head, one thing you can try is to call QWizard's next slot twice to go the 3 page if the local has been set. I think it should behave the same as if the user clicked on the next button.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi and welcome to devnet,

        From the top of my head, one thing you can try is to call QWizard's next slot twice to go the 3 page if the local has been set. I think it should behave the same as if the user clicked on the next button.

        M Offline
        M Offline
        Marc Peters
        wrote on last edited by
        #3

        @SGaist I've tried this after setting the startId, but the QWizard's currentId is set to -1 at this point so it just returns out of the next() call without doing anything unfortunately.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Why set the startId ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply
          0
          • SGaistS SGaist

            Why set the startId ?

            M Offline
            M Offline
            Marc Peters
            wrote on last edited by Marc Peters
            #5

            @SGaist I suppose it doesn't matter if I don't set the startId, it'll default to the first page added to the QWizard anyway. I originally had logic to check if the config exists and then set the startId to page 3, otherwise, set it to page 1. When it is set to page 3, the choices page is the first page displayed which is nice, but the back button is disabled.

            I've tried forcing an enable on the QWizard's back button, but since the QWizard page history does not have anything in it, the button remains disabled.

            I'm starting to think the QStackedWidget approach will suit my needs...

            Edit:

            Converted my QWizard to a QDialog and the QWizardPages to QWidgets. Added a QStackedWidget to the QDialog and added each page as its own widget. I have better control of the wizard flow which suits my needs.

            Thanks!

            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