Merge pull request #2209 from splintor/master
Pass Escape key to internal widget of ScrollArea
This commit is contained in:
commit
5eb49c9d68
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue