Results 1 to 3 of 3

Thread: How to move back several pages in QWizard?

  1. #1
    Join Date
    Nov 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1

    Default How to move back several pages in QWizard?

    Thank you for your times reading this question.

    My wizard is a guidance for the end-users to setup a device. It has 8 steps.
    Normally the wizard moves step-by-step from S1 to S8. But on the last page S8, the wizard opens a full-screen dialog and performs some tests on the device. If the test has passed, the wizard is ended. If the test has failed, the user need to go back to the S4 to check the device installation process again. It sounds simple, right?

    On S8, when the user clicks on CustomButton1, I used this code to move back to S4:

    restart();
    while(wizard()->currentId() != 4) wizard()->button(QWizard::NextButton)->click();

    It works! and the wizard moves to S4 flawlessly, but actually the user cannot see the CustomButton1 because the dialog is in full-screen mode. For that reason, I implemented another button on the dialog, and when the user clicks on that button, the following code will "click" the CustomButton1:

    wizard()->button(QWizard::CustomButton1)->click();

    It seems OK when the wizard moves back to S4 also, but the problem is: after going back to S4, if the user clicks on BACK button to move to S3, the first click doesn't make any change. The user always has to click twice to move back to S3.

    Any suggestion will be appreciated.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: How to move back several pages in QWizard?

    Creating non-linear wizards is described with examples (License Wizard Example) in the QWizard documentation. Essentially you give each page an ID, and then override QWizardPage::nextId() or QWizard::nextId() to drive where the next button takes you. In nextId() for S8 run the test and if it passes return -1 (i.e. end of wizard) otherwise return the id for S4.

  3. #3
    Join Date
    Nov 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1

    Default Re: How to move back several pages in QWizard?

    Thank ChrisW67 for your fast replying.
    I tried as you suggested but the S8 can move forward (and skip some pages in the between), for example, to S11 not S4.

    And the problem here is: there must be something difference between a real "hardware click" and the "software click" on the same button. If I use my mouse to hit the CustomButton1, it goes back to S4 flawlessly. If I click on other button, then that button fires a click to CustomButton1, the wizard still goes back to S4, but the BACK button on S4 must be clicked twice in case I want to move back to S3. Weird huh?

Similar Threads

  1. Problem in Move Move Event Handler.
    By redgoof in forum Qt Programming
    Replies: 0
    Last Post: 7th April 2010, 12:45
  2. How to set QWizard size equal for all its pages
    By kalos80 in forum Qt Programming
    Replies: 0
    Last Post: 9th June 2009, 10:00
  3. QWizard with QWizardPages gives blank pages?
    By Tiansen in forum Qt Programming
    Replies: 4
    Last Post: 4th March 2008, 07:45
  4. Move Rectangle on mouse Move
    By vermarajeev in forum Qt Programming
    Replies: 24
    Last Post: 14th May 2007, 06:34
  5. switching between pages
    By Kapil in forum Newbie
    Replies: 9
    Last Post: 6th March 2006, 11:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.