Android Manifest Editor: Eat keyboard events

And thus prevent them from affecting the wrong widget

Change-Id: Iacf326630a80c2d53e8852ea8055d7bd5f87ed68
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Daniel Teske
2013-10-02 15:15:15 +02:00
parent 25f7952f56
commit 71d6b2b10d

View File

@@ -137,6 +137,7 @@ void AndroidManifestEditorWidget::initializePage()
// If the user clicks on the mainwidget it gets focus, even though that's not visible
// This is to prevent the parent, the actual basetexteditorwidget from getting focus
mainWidget->setFocusPolicy(Qt::WheelFocus);
mainWidget->installEventFilter(this);
Core::IContext *myContext = new Core::IContext(this);
myContext->setWidget(mainWidget);
@@ -460,6 +461,12 @@ bool AndroidManifestEditorWidget::eventFilter(QObject *obj, QEvent *event)
}
}
if (obj == m_overlayWidget)
if (event->type() == QEvent::KeyPress
|| event->type() == QEvent::KeyRelease) {
return true;
}
return TextEditor::PlainTextEditorWidget::eventFilter(obj, event);
}