Pre-accept events
authorAlan Alpert <alan.alpert@nokia.com>
Wed, 27 Apr 2011 03:27:13 +0000 (13:27 +1000)
committerAlan Alpert <alan.alpert@nokia.com>
Wed, 27 Apr 2011 23:52:47 +0000 (09:52 +1000)
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)

src/declarative/items/qsgcanvas.cpp

index a325f0d..5fc5c76 100644 (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();