Pass Escape key to internal widget of ScrollArea

Fix for https://github.com/telegramdesktop/tdesktop/issues/2208

Signed-off-by: Shmulik Flint <splintor@gmail.com>
This commit is contained in:
Shmulik Flint 2016-07-03 00:43:54 +03:00
parent da293755ef
commit 87bb221cc3

View File

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