diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-01-06 17:16:27 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-01-07 09:52:29 (GMT) |
commit | 828b1299e1ecb2da23799a2e49370e00dcf9c126 (patch) | |
tree | 6bbb15ada48bfbaf71f36c5c28e2d94c96d4b180 /src/gui/graphicsview/qgraphicsscene.cpp | |
parent | 089ee7094eabb2058b478f5d2f306a69f6c0b3bf (diff) | |
download | Qt-828b1299e1ecb2da23799a2e49370e00dcf9c126.zip Qt-828b1299e1ecb2da23799a2e49370e00dcf9c126.tar.gz Qt-828b1299e1ecb2da23799a2e49370e00dcf9c126.tar.bz2 |
Fixes a crash when destroying and creating QApplication.
Moved the gestureManager pointer to a QApplicationPrivate to make sure if
QApplication object is destroyed, QGestureManager pointer is set to zero.
Task-number: QTBUG-7029
Reviewed-by: Thiago
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index e2e5714..034d1f7 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -1132,8 +1132,9 @@ bool QGraphicsScenePrivate::filterEvent(QGraphicsItem *item, QEvent *event) bool QGraphicsScenePrivate::sendEvent(QGraphicsItem *item, QEvent *event) { if (QGraphicsObject *object = item->toGraphicsObject()) { - if (qt_gestureManager) { - if (qt_gestureManager->filterEvent(object, event)) + QGestureManager *gestureManager = QApplicationPrivate::instance()->gestureManager; + if (gestureManager) { + if (gestureManager->filterEvent(object, event)) return true; } } @@ -6152,9 +6153,10 @@ void QGraphicsScenePrivate::cancelGesturesForChildren(QGesture *original, QWidge } } - Q_ASSERT(qt_gestureManager); // it would be very odd if we got called without a manager. + QGestureManager *gestureManager = QApplicationPrivate::instance()->gestureManager; + Q_ASSERT(gestureManager); // it would be very odd if we got called without a manager. for (setIter = canceledGestures.begin(); setIter != canceledGestures.end(); ++setIter) { - qt_gestureManager->recycle(*setIter); + gestureManager->recycle(*setIter); gestureTargets.remove(*setIter); } } |