Results 1 to 4 of 4

Thread: [Help]: How to make a QWizardPage unvisited?

  1. #1
    Join Date
    Jun 2009
    Location
    Zhengzhou, China
    Posts
    16
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X

    Question [Help]: How to make a QWizardPage unvisited?

    Hi, everyone

    I want to create a wizard with some kind of loop, so how to make a visited page unvisited?

    Thanks for advance!

    DONG Li

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: [Help]: How to make a QWizardPage unvisited?

    Take a look at QWizard::nextId(), it helps you create a non-linear wizard.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Dec 2012
    Posts
    9
    Thanks
    3
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Android

    Default Re: [Help]: How to make a QWizardPage unvisited?

    QWizard::nextId() doesn't allow to make loops, because as soon as you come back to a page you already visited, QWizard won't let you visit it again.

    The source: qwizard.cpp explicitly shows that this is impossible:

    Qt Code:
    1. void QWizard::next()
    2. {
    3. Q_D(QWizard);
    4.  
    5. if (d->current == -1)
    6. return;
    7.  
    8. if (validateCurrentPage()) {
    9. int next = nextId();
    10. if (next != -1) {
    11. if (d->history.contains(next)) {
    12. qWarning("QWizard::next: Page %d already met", next);
    13. return;
    14. }
    15. if (!d->pageMap.contains(next)) {
    16. qWarning("QWizard::next: No such page %d", next);
    17. return;
    18. }
    19. d->switchToPage(next, QWizardPrivate::Forward);
    20. }
    21. }
    22. }
    To copy to clipboard, switch view to plain text mode 

    Has anyone got an idea of a way to force visiting a page, or to remove a page from the history, or to disable storing pages in the history? (Let's see if people still visit threads from 2009 ^^)

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: [Help]: How to make a QWizardPage unvisited?

    Maybe calling back() until the current page is the one you want to return to?

    Cheers,
    _

Similar Threads

  1. [Help]: How to make a QWizardPage unvisited?
    By dongli in forum Qt Tools
    Replies: 1
    Last Post: 29th June 2009, 15:12
  2. Window OS make distclean && qmake && make one line
    By patrik08 in forum General Programming
    Replies: 4
    Last Post: 22nd March 2007, 10:43
  3. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.