From 667eb57169dfb0785baddf85d7889122f11d8f3e Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 13 Feb 2019 15:57:01 +0100 Subject: [PATCH] UI Introduction: Allow left cursor key for "back" Or right cursor in case of right-to-left layout direction Change-Id: I058ad4ecc5e07f572cf16abc8a94da430b65fda3 Reviewed-by: Tim Jenssen --- src/plugins/welcome/introductionwidget.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/plugins/welcome/introductionwidget.cpp b/src/plugins/welcome/introductionwidget.cpp index d0c993b6e8a..d10cb76be2f 100644 --- a/src/plugins/welcome/introductionwidget.cpp +++ b/src/plugins/welcome/introductionwidget.cpp @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -349,8 +350,17 @@ void IntroductionWidget::keyPressEvent(QKeyEvent *ke) { if (ke->key() == Qt::Key_Escape) finish(); - else if (ke->modifiers() == Qt::NoModifier) - step(); + else if ((ke->modifiers() + & (Qt::ControlModifier | Qt::AltModifier | Qt::ShiftModifier | Qt::MetaModifier)) + == Qt::NoModifier) { + const Qt::Key backKey = QGuiApplication::isLeftToRight() ? Qt::Key_Left : Qt::Key_Right; + if (ke->key() == backKey) { + if (m_step > 0) + setStep(m_step - 1); + } else { + step(); + } + } } void IntroductionWidget::mouseReleaseEvent(QMouseEvent *me)