summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx
diff options
context:
space:
mode:
authorIan Walters <ian.walters@nokia.com>2009-05-08 00:43:56 (GMT)
committerIan Walters <ian.walters@nokia.com>2009-05-08 00:43:56 (GMT)
commit6cfefeac5db91186027fc203cf9f8f354a0eedac (patch)
tree9730e86525bb9a758b92803e2681f9657b06b952 /src/declarative/fx
parent2d76308b923717e613a499894440185fa618b5e7 (diff)
downloadQt-6cfefeac5db91186027fc203cf9f8f354a0eedac.zip
Qt-6cfefeac5db91186027fc203cf9f8f354a0eedac.tar.gz
Qt-6cfefeac5db91186027fc203cf9f8f354a0eedac.tar.bz2
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.
Diffstat (limited to 'src/declarative/fx')
-rw-r--r--src/declarative/fx/qfxkeyproxy.cpp8
1 files 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<QFxItem *> *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;
}