Merge pull request #2209 from splintor/master

Pass Escape key to internal widget of ScrollArea
This commit is contained in:
John Preston 2016-07-04 14:52:40 +03:00 committed by GitHub
commit 5eb49c9d68
1 changed files with 2 additions and 0 deletions

View File

@ -651,6 +651,8 @@ void ScrollArea::moveEvent(QMoveEvent *e) {
void ScrollArea::keyPressEvent(QKeyEvent *e) { void ScrollArea::keyPressEvent(QKeyEvent *e) {
if ((e->key() == Qt::Key_Up || e->key() == Qt::Key_Down) && e->modifiers().testFlag(Qt::AltModifier)) { if ((e->key() == Qt::Key_Up || e->key() == Qt::Key_Down) && e->modifiers().testFlag(Qt::AltModifier)) {
e->ignore(); e->ignore();
} else if(e->key() == Qt::Key_Escape || e->key() == Qt::Key_Back) {
((QObject*)widget())->event(e);
} else { } else {
QScrollArea::keyPressEvent(e); QScrollArea::keyPressEvent(e);
} }