diff options
Diffstat (limited to 'src/gui/dialogs/qwizard.cpp')
-rw-r--r-- | src/gui/dialogs/qwizard.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/gui/dialogs/qwizard.cpp b/src/gui/dialogs/qwizard.cpp index fbc7a79..20c9edc 100644 --- a/src/gui/dialogs/qwizard.cpp +++ b/src/gui/dialogs/qwizard.cpp @@ -1350,6 +1350,21 @@ void QWizardPrivate::updateCurrentPage() updateButtonTexts(); } +static QString object_name_for_button(QWizard::WizardButton which) +{ + switch (which) { + case QWizard::CommitButton: + return QLatin1String("qt_wizard_") + QLatin1String("commit"); + case QWizard::FinishButton: + return QLatin1String("qt_wizard_") + QLatin1String("finish"); + case QWizard::CancelButton: + return QLatin1String("qt_wizard_") + QLatin1String("cancel"); + default: + // Make navigation buttons detectable as passive interactor in designer + return QLatin1String("__qt__passive_wizardbutton") + QString::number(which); + } +} + bool QWizardPrivate::ensureButton(QWizard::WizardButton which) const { Q_Q(const QWizard); @@ -1361,19 +1376,7 @@ bool QWizardPrivate::ensureButton(QWizard::WizardButton which) const QStyle *style = q->style(); if (style != QApplication::style()) // Propagate style pushButton->setStyle(style); - // Make navigation buttons detectable as passive interactor in designer - switch (which) { - case QWizard::CommitButton: - case QWizard::FinishButton: - case QWizard::CancelButton: - break; - default: { - QString objectName = QLatin1String("__qt__passive_wizardbutton"); - objectName += QString::number(which); - pushButton->setObjectName(objectName); - } - break; - } + pushButton->setObjectName(object_name_for_button(which)); #ifdef Q_WS_MAC pushButton->setAutoDefault(false); #endif |