diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-05-12 14:38:08 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-05-18 13:17:10 (GMT) |
commit | e599814feb5bc62c4a419d332bcca39bbea15190 (patch) | |
tree | 53abeb4067e4a0c34748655690db0a2ecdd1a5ec | |
parent | 20b05e38c4f364e4d21dab79a4f66103e6fb2dc3 (diff) | |
download | Qt-e599814feb5bc62c4a419d332bcca39bbea15190.zip Qt-e599814feb5bc62c4a419d332bcca39bbea15190.tar.gz Qt-e599814feb5bc62c4a419d332bcca39bbea15190.tar.bz2 |
Small improvement in gesturemanager and a fix for potential crash
-rw-r--r-- | src/gui/kernel/qgesturemanager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index 1dda34c..2750df4 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -519,7 +519,7 @@ bool QGestureManager::sendGestureEvent(QWidget *receiver, const QSet<QGesture*> it != e; ++it) { QGesture *g = *it; QGesturePrivate *gd = g->d_func(); - if (!gd->widget && (g->state() == Qt::GestureStarted || g->state() == Qt::GestureFinished)) { + if (!gd->widget && (g->state() == Qt::GestureStarted || gd->singleshot)) { startedGestures.insert(g); // find the target widget QWidget *w = receiver; @@ -575,7 +575,7 @@ bool QGestureManager::sendGestureEvent(QWidget *receiver, const QSet<QGesture*> QWidget *w = gd->widget; gd->widget = 0; - if (!w->isWindow()) { + if (w && !w->isWindow()) { g->translate(w->pos()); w = w->parentWidget(); QPoint offset; |