Results 1 to 6 of 6

Thread: QWizard and QPushButton

  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 and QPushButton

    Hi all,
    I would like to know if it's possible to have a QPushButton in a QWizard page having the same role of the "Next button".. and how to do it
    Many thanks

  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: QWizard and QPushButton

    What is a problem : do You want to have 2 buttons or to change text on Next button ?

  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 and QPushButton

    I would like to have another button (a QPushButton) with the same role of the next button.. I mean if I click on it I would like to go next!

    I tried to connect this second button like this...

    connect(goButton, SIGNAL(clicked()), this, SLOT(example()));

    ...

    void myWizardPage::example()
    {
    myWizardPage::validatePage();
    }

    but it doesn't work..

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QWizard and QPushButton

    Only a QWizard would normally go to next page. Why do you want to do this from the QWizardPage?

    you could try this, though
    Qt Code:
    1. void myWizardPage::example()
    2. {
    3. QWizard* wiz = wizard();
    4. if (wiz == NULL)
    5. return;
    6.  
    7. wiz->next();
    8. }
    To copy to clipboard, switch view to plain text mode 
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  5. #5
    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: QWizard and QPushButton

    What it is "it doesn't work" ? Show us real code.
    Just read about QWizard buttons especially custom buttons and QWizard signal customButtonClicked(int).

  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 and QPushButton

    I wrote "it doesn't work" because it did go correctly on validatePage() method but then it didn't go on the next page.

    Anyway your solution works perfectly, and it goes on the next page ! Great!

    Thank you so much

    Roby

Similar Threads

  1. QWizard fit
    By baray98 in forum Qt Programming
    Replies: 7
    Last Post: 14th November 2010, 16:27
  2. Replies: 0
    Last Post: 22nd February 2010, 09:30
  3. Help with QWizard
    By afflictedd2 in forum Qt Programming
    Replies: 3
    Last Post: 14th April 2009, 21:23
  4. QWizard
    By rmagro in forum Qt Programming
    Replies: 8
    Last Post: 26th September 2008, 20:41
  5. Replies: 3
    Last Post: 26th September 2006, 12:16

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.