Pre-accept events

Key handler expects events to be accepted, and will ignore them if
necessary.

Change-Id: I8ee110d70c98ff7c2de107b44e7d51aab12678c4
Reviewed-by: Michael Brasser
(cherry picked from commit 6476bbea1d7905f083789224accc8f4b43a0779b)
This commit is contained in:
Alan Alpert 2011-04-27 13:27:13 +10:00
parent 31dd5d55dd
commit f837a28854
1 changed files with 2 additions and 0 deletions

View File

@ -1521,6 +1521,7 @@ bool QSGCanvas::sendEvent(QSGItem *item, QEvent *e)
switch (e->type()) {
case QEvent::KeyPress:
case QEvent::KeyRelease:
e->accept();
QSGItemPrivate::get(item)->deliverKeyEvent(static_cast<QKeyEvent *>(e));
while (!e->isAccepted() && (item = item->parentItem())) {
e->accept();
@ -1528,6 +1529,7 @@ bool QSGCanvas::sendEvent(QSGItem *item, QEvent *e)
}
break;
case QEvent::InputMethod:
e->accept();
QSGItemPrivate::get(item)->deliverInputMethodEvent(static_cast<QInputMethodEvent *>(e));
while (!e->isAccepted() && (item = item->parentItem())) {
e->accept();