forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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)
|
||||
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)
|
||||
|
Reference in New Issue
Block a user