QWizard/Windows: Add keyboard shortcut for 'Next'/'Back'.

Task-number: QTBUG-35203

Change-Id: If7312e8675b21be9dc6836b92805dc87007205e7
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
bb10
Friedemann Kleint 2014-01-07 16:35:15 +01:00 committed by The Qt Project
parent 658d3114d2
commit 6714196f45
2 changed files with 7 additions and 0 deletions

View File

@ -1462,6 +1462,11 @@ void QWizardPrivate::updateButtonTexts()
btns[i]->setText(buttonDefaultText(wizStyle, i, this));
}
}
// Vista: Add shortcut for 'next'. Note: native dialogs use ALT-Right
// even in RTL mode, so do the same, even if it might be counter-intuitive.
// The shortcut for 'back' is set in class QVistaBackButton.
if (btns[QWizard::NextButton])
btns[QWizard::NextButton]->setShortcut(isVistaThemeEnabled() ? QKeySequence(Qt::ALT | Qt::Key_Right) : QKeySequence());
}
void QWizardPrivate::updateButtonLayout()

View File

@ -183,6 +183,8 @@ QVistaBackButton::QVistaBackButton(QWidget *widget)
: QAbstractButton(widget)
{
setFocusPolicy(Qt::NoFocus);
// Native dialogs use ALT-Left even in RTL mode, so do the same, even if it might be counter-intuitive.
setShortcut(QKeySequence(Qt::ALT | Qt::Key_Left));
}
QSize QVistaBackButton::sizeHint() const