Results 1 to 9 of 9

Thread: QWizard

  1. #1
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QWizard

    Hi guys,

    I am working with Qwizard..
    I noticed that it is not possible to visit a page that has already been visited..

    Is it really like this?

    If not, which is the way to re-call from a later step a page which has been visited a step before..

    Thank you

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWizard

    doesn't this slot QWizard::back work?

  3. #3
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWizard

    It works, but I don't want to get to one page back but to a page visited some steps before
    (I was trying to use
    Qt Code:
    1. return SampleWizard::Page_XYZ;
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWizard

    try to set needed page using void setStartId ( int id ) and then call
    void restart ()

  5. #5
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWizard

    it does not work..
    maybe be it is not possible to do so..

    Indeed In qtwizard.cpp is:
    Qt Code:
    1. if (validateCurrentPage()) {
    2. int next = nextId();
    3. if (next != -1) {
    4. if (d->history.contains(next)) {
    5. qWarning("QWizard::next: Page %d already met", next);
    6. return;
    7. }
    8. if (!d->pageMap.contains(next)) {
    9. qWarning("QWizard::next: No such page %d", next);
    10. return;
    11. }
    12. d->switchToPage(next, QWizardPrivate::Forward);
    13. }
    14. }
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWizard

    we would need something to set tha a certain page has not been visited!!even if it is not true..

    is there ??

  7. #7
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWizard

    so, I know this is a trick (), but I managed to go to needed page
    Qt Code:
    1. LicenseWizard::LicenseWizard(QWidget *parent)
    2. : QWizard(parent)
    3. {
    4. setPage(Page_Intro, new IntroPage);
    5. setPage(Page_Evaluate, new EvaluatePage);
    6. setPage(Page_Register, new RegisterPage);
    7. setPage(Page_Details, new DetailsPage);
    8. setPage(Page_Conclusion, new ConclusionPage);
    9.  
    10. setStartId(Page_Intro);
    11.  
    12. #ifndef Q_WS_MAC
    13. setWizardStyle(ModernStyle);
    14. #endif
    15. setOption(HaveHelpButton, true);
    16. setPixmap(QWizard::LogoPixmap, QPixmap(":/images/logo.png"));
    17.  
    18. connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));
    19. QAbstractButton *b = this->button(QWizard::BackButton);
    20. connect(b, SIGNAL(clicked()), this, SLOT(goToSecondPage()));
    21.  
    22. setWindowTitle(tr("License Wizard"));
    23. }
    24.  
    25. void LicenseWizard::goToSecondPage()
    26. {
    27. setStartId(Page_Evaluate);
    28. restart();
    29. }
    To copy to clipboard, switch view to plain text mode 

  8. The following user says thank you to spirit for this useful post:

    rmagro (26th September 2008)

  9. #8
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWizard

    Sorry Spirit but this way you get the secondPage each time you press back button, right?

  10. #9
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWizard

    yup, but I just wanted to show that it is possible.

Similar Threads

  1. QWizard signal problem
    By oguzy in forum Qt Programming
    Replies: 4
    Last Post: 10th September 2008, 10:43
  2. QWizard, QComboBox and registerField() issue
    By RThaden in forum Qt Programming
    Replies: 1
    Last Post: 27th May 2008, 12:18
  3. Create QWizard UI
    By jd in forum Qt Tools
    Replies: 1
    Last Post: 17th March 2008, 12:36
  4. QWizard and banner pixmap
    By desch in forum Qt Programming
    Replies: 8
    Last Post: 7th January 2008, 10:28
  5. Style Sheet on QWizard
    By desch in forum Qt Programming
    Replies: 2
    Last Post: 6th December 2007, 17:12

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.