QWizard::nextId() doesn't allow to make loops, because as soon as you come back to a page you already visited, QWizard won't let you visit it again.
The source: qwizard.cpp explicitly shows that this is impossible:
void QWizard::next()
{
Q_D(QWizard);
if (d->current == -1)
return;
if (validateCurrentPage()) {
int next = nextId();
if (next != -1) {
if (d->history.contains(next)) {
qWarning("QWizard::next: Page %d already met", next);
return;
}
if (!d->pageMap.contains(next)) {
qWarning("QWizard::next: No such page %d", next);
return;
}
d->switchToPage(next, QWizardPrivate::Forward);
}
}
}
void QWizard::next()
{
Q_D(QWizard);
if (d->current == -1)
return;
if (validateCurrentPage()) {
int next = nextId();
if (next != -1) {
if (d->history.contains(next)) {
qWarning("QWizard::next: Page %d already met", next);
return;
}
if (!d->pageMap.contains(next)) {
qWarning("QWizard::next: No such page %d", next);
return;
}
d->switchToPage(next, QWizardPrivate::Forward);
}
}
}
To copy to clipboard, switch view to plain text mode
Has anyone got an idea of a way to force visiting a page, or to remove a page from the history, or to disable storing pages in the history? (Let's see if people still visit threads from 2009 ^^)
Bookmarks