Fix Wizard accept to work with the setAccept accept funcs

This commit is contained in:
Gary Talent 2017-05-26 05:04:49 -05:00
parent 38a3113ab6
commit 287168a6cc

View File

@ -331,9 +331,9 @@ void Wizard::setAccept(std::function<int()> acceptFunc) {
void Wizard::accept() { void Wizard::accept() {
auto page = dynamic_cast<WizardFormPage*>(currentPage()); auto page = dynamic_cast<WizardFormPage*>(currentPage());
if (page == nullptr || page->accept() == 0) { if (page != nullptr && page->accept() == 0) {
QDialog::accept(); QDialog::accept();
} else if(m_acceptFunc != nullptr && m_acceptFunc() == 0) { } else if (m_acceptFunc != nullptr && m_acceptFunc() == 0) {
QDialog::accept(); QDialog::accept();
} }
} }