Results 1 to 4 of 4

Thread: How to disable NextButton in QWizard ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Smile How to disable NextButton in QWizard ?

    Hi!

    I am working in Qt 4.3 and have created four pages. In the second page, it has a start pushbutton which is used to calibrate cards. I want to make the start pushbutton enabled and the Qwizard NextButton disabled when initialized. To do this I tried to disable the button in the initializePage() or QWizard’s nextId() funtion, but both do not work.

    In Qwizard::nextId():
    Qt Code:
    1. button(Qwizard::NextButton)->setEnabled(false);
    To copy to clipboard, switch view to plain text mode 

    In QwizardPage::initializePage():
    Qt Code:
    1. QabstractButton *btn = parentHandle->button(Qwizard::NextButton);
    2. Btn->setEnabled(false);
    To copy to clipboard, switch view to plain text mode 
    After I called wizard->show(), I do the following:
    Qt Code:
    1. wizard->button(Qwizard::NextButton)->setEnabled(false);
    To copy to clipboard, switch view to plain text mode 
    This can disable the QWizard’s NextButton, but if I call it before wizard->show(), it does not work.
    If I connect the start pushbutton click signal to a slot, which is to disable the Qwizard’s NextButton, when I click the button it can disable the QWizard’s NextButton. However, I don’t want it to be disabled when I click the button, only when it is initialized.

    Any suggestion will be greatly appreciate!
    Last edited by jpn; 26th May 2008 at 11:19. Reason: missing [code] tags

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
  •  
Qt is a trademark of The Qt Company.