Results 1 to 5 of 5

Thread: How to disable the Next button in a wizard until a certain condition is met

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2013
    Posts
    25
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default How to disable the Next button in a wizard until a certain condition is met

    Hi all
    I was wondering how i would disable the Next button in a wizard page until i have set only four checkboxes checked or clicked them among a bunch of other checkboxes in the wizard page?

  2. #2
    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: How to disable the Next button in a wizard until a certain condition is met


  3. #3
    Join Date
    Sep 2013
    Posts
    25
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to disable the Next button in a wizard until a certain condition is met

    So i did this:
    Qt Code:
    1. connect(checkmeCheckBox, SIGNAL(toggled()),wizard1->button(QWizard::NextButton), SLOT(reactToToggle()));
    2. ...
    3. ...
    4. ...
    5. //for all the checkboxes in myPage
    6.  
    7. int myPage::reactToToggle(bool checked)
    8. {
    9. static int i = 0;
    10. if(checked)
    11. ++i;
    12. return i;
    13. }
    14.  
    15. void myPage::returns(bool checked)
    16. {
    17. if(reactToToggle(checked)== 3)
    18. wizard1->button(QWizard::NextButton)->setEnabled(true);
    19. else
    20. wizard1->button(QWizard::NextButton)->setDisabled(true);
    21. }
    To copy to clipboard, switch view to plain text mode 

    but the compiler returns a SIGSEGV error, is there anything wrong with my implementation apart from the SIGSEGV exception???

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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: How to disable the Next button in a wizard until a certain condition is met

    Why didn't you use isComplete()?
    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.


  5. #5
    Join Date
    Sep 2013
    Posts
    25
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to disable the Next button in a wizard until a certain condition is met

    Ok thanks it worked.
    Hey could you check out my earlier post, StudentQt was helping me with it but he kinda got stuck too
    It's here:
    http://www.qtcentre.org/threads/5616...and-checkboxes

Similar Threads

  1. Replies: 4
    Last Post: 11th September 2013, 17:32
  2. Replies: 1
    Last Post: 29th September 2011, 11:14
  3. Disable button click
    By "BumbleBee" in forum Newbie
    Replies: 19
    Last Post: 30th March 2011, 13:16
  4. How to disable a button in a QFileDialog?
    By TeresaML in forum Qt Programming
    Replies: 2
    Last Post: 18th June 2010, 18:41
  5. how to disable the maximize button?
    By zabeehkhan in forum Qt Programming
    Replies: 4
    Last Post: 14th April 2010, 07:26

Tags for this Thread

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.