c++qtqwizard

Qt QWizard validateCurrentPage isn't called on last page


I have a QWizard, and I override validateCurrentPage() in order to perform actions before passing to the next page. This function is working well on all pages, except for the last page - where Finish is pressed. the accept() function is called, but not validateCurrentPage().

Judging by Qt docs:

This virtual function is called by QWizard when the user clicks Next or Finish to perform some last-minute validation

this function was supposed to be called just like in any other page.

Why isn't it working?


Solution

  • The problem was that I overridden QDialog::accept() and unless I call QDialog::accept(), validateCurrentPage() wouldn't be called.