Results 1 to 4 of 4

Thread: Problems with custom wizard

  1. #1
    Join Date
    Jan 2015
    Location
    Russia, Moscow
    Posts
    6
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Question Problems with custom wizard

    Hello,
    I have some problems with custom wizard.
    On first page user enters some text in qlineedit. Than he presses Next. After that the wizard must make a query to MySQL, get data, check it and:
    1. If data is good - set next page id (the value of id depends on data)
    2. If data is bad - don't do anything, just stay on current page, so the user can correct text in qlineedit.

    How to do it? Where and when wizard must make a query? I don't understand Qt wizard logic.
    I saws examples in Qt, saw that I should override nextId() etc. But there is no examples when wizard takes data outside.

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problems with custom wizard

    Override QWizardPage::validatePage method and return true if all is OK.

  3. #3
    Join Date
    Jan 2015
    Location
    Russia, Moscow
    Posts
    6
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Problems with custom wizard

    This function doesn't work, because it never called.
    I attached a trivial project of wizard. What is wrong?
    Attached Files Attached Files

  4. #4
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problems with custom wizard

    1. QWizardPage::validatePage is NOT const so FirstPage::validatePage() may not have attribute const.
    2. Wizard::validateCurrentPage() is invalid (attribute const) and even unnecessary.

  5. The following user says thank you to Lesiok for this useful post:

    _Dron_ (28th January 2015)

Similar Threads

  1. Problems with QtQuick wizard generated project
    By enrico5th in forum Qt Quick
    Replies: 9
    Last Post: 17th March 2014, 15:55
  2. Replies: 3
    Last Post: 9th August 2012, 23:21
  3. Creating custom qt widget + not appearing in wizard
    By kewal.deshpande in forum Qt Programming
    Replies: 1
    Last Post: 4th March 2012, 04:26
  4. Replies: 1
    Last Post: 29th September 2011, 11:14
  5. Custom Qtoolbox : some problems
    By dr23 in forum Qt Programming
    Replies: 1
    Last Post: 6th January 2006, 13:01

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.