summaryrefslogtreecommitdiff
path: root/src/plugins/welcome
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2019-02-13 15:57:01 +0100
committerEike Ziller <eike.ziller@qt.io>2019-02-13 15:47:49 +0000
commit667eb57169dfb0785baddf85d7889122f11d8f3e (patch)
treeb9c3a75e960b124e7551088bc55ddc1787656488 /src/plugins/welcome
parent80cd9cfa8a67c91290587aecb8514b2ad634b6a5 (diff)
downloadqt-creator-667eb57169dfb0785baddf85d7889122f11d8f3e.tar.gz
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 <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/welcome')
-rw-r--r--src/plugins/welcome/introductionwidget.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/welcome/introductionwidget.cpp b/src/plugins/welcome/introductionwidget.cpp
index d0c993b6e8..d10cb76be2 100644
--- a/src/plugins/welcome/introductionwidget.cpp
+++ b/src/plugins/welcome/introductionwidget.cpp
@@ -31,6 +31,7 @@
#include <utils/stylehelper.h>
#include <QEvent>
+#include <QGuiApplication>
#include <QKeyEvent>
#include <QLabel>
#include <QPainter>
@@ -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)