From 6cfefeac5db91186027fc203cf9f8f354a0eedac Mon Sep 17 00:00:00 2001 From: Ian Walters Date: Fri, 8 May 2009 10:43:56 +1000 Subject: Don't assume will get non-0 item to send key to. Before this change was getting crashes when the window lost focus. This is because the target was non-0, but the focusItem stored for that target was 0. --- src/declarative/fx/qfxkeyproxy.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/declarative/fx/qfxkeyproxy.cpp b/src/declarative/fx/qfxkeyproxy.cpp index 1bb54ec..848b2d9 100644 --- a/src/declarative/fx/qfxkeyproxy.cpp +++ b/src/declarative/fx/qfxkeyproxy.cpp @@ -94,9 +94,9 @@ QList *QFxKeyProxy::targets() const void QFxKeyProxy::keyPressEvent(QKeyEvent *e) { for (int ii = 0; ii < d->targets.count(); ++ii) { - QSimpleCanvasItem *i = d->targets.at(ii); + QSimpleCanvasItem *i = canvas()->focusItem(d->targets.at(ii)); if (i) - canvas()->focusItem(i)->keyPressEvent(e); + i->keyPressEvent(e); if (e->isAccepted()) return; } @@ -105,9 +105,9 @@ void QFxKeyProxy::keyPressEvent(QKeyEvent *e) void QFxKeyProxy::keyReleaseEvent(QKeyEvent *e) { for (int ii = 0; ii < d->targets.count(); ++ii) { - QSimpleCanvasItem *i = d->targets.at(ii); + QSimpleCanvasItem *i = canvas()->focusItem(d->targets.at(ii)); if (i) - canvas()->focusItem(i)->keyReleaseEvent(e); + i->keyReleaseEvent(e); if (e->isAccepted()) return; } -- cgit v0.12