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 <utils/stylehelper.h>
|
||||||
|
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
|
#include <QGuiApplication>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
@@ -349,8 +350,17 @@ void IntroductionWidget::keyPressEvent(QKeyEvent *ke)
|
|||||||
{
|
{
|
||||||
if (ke->key() == Qt::Key_Escape)
|
if (ke->key() == Qt::Key_Escape)
|
||||||
finish();
|
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();
|
step();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IntroductionWidget::mouseReleaseEvent(QMouseEvent *me)
|
void IntroductionWidget::mouseReleaseEvent(QMouseEvent *me)
|
||||||
|
Reference in New Issue
Block a user