summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qwizard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/dialogs/qwizard.cpp')
-rw-r--r--src/widgets/dialogs/qwizard.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index 0ad1dad1b80..1cd294e5eab 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -1704,6 +1704,10 @@ void QWizardPrivate::_q_updateButtonStates()
btn.finish->setVisible(buttonLayoutContains(QWizard::FinishButton)
&& (canFinish || (opts & QWizard::HaveFinishButtonOnEarlyPages)));
+ if (!(opts & QWizard::NoCancelButton))
+ btn.cancel->setVisible(buttonLayoutContains(QWizard::CancelButton)
+ && (canContinue || !(opts & QWizard::NoCancelButtonOnLastPage)));
+
bool useDefault = !(opts & QWizard::NoDefaultButton);
if (QPushButton *nextPush = qobject_cast<QPushButton *>(btn.next))
nextPush->setDefault(canContinue && useDefault && !commitPage);
@@ -2188,6 +2192,7 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
\value HaveCustomButton1 Show the first user-defined button (CustomButton1).
\value HaveCustomButton2 Show the second user-defined button (CustomButton2).
\value HaveCustomButton3 Show the third user-defined button (CustomButton3).
+ \value NoCancelButtonOnLastPage Don't show the \uicontrol Cancel button on the last page.
\sa setOptions(), setOption(), testOption()
*/
@@ -2642,7 +2647,7 @@ void QWizard::setOptions(WizardOptions options)
d->updateButtonLayout();
} else if (changed & (NoBackButtonOnStartPage | NoBackButtonOnLastPage
| HaveNextButtonOnLastPage | HaveFinishButtonOnEarlyPages
- | DisabledBackButtonOnLastPage)) {
+ | DisabledBackButtonOnLastPage | NoCancelButtonOnLastPage)) {
d->_q_updateButtonStates();
}