diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-10-22 20:09:03 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-10-26 10:42:19 (GMT) |
commit | 706c3f846b97c74c5e15395b6e2d306c522ba769 (patch) | |
tree | 8bd9f7f7db0ceffcd78ca85b91f6a9cf30686a09 /src | |
parent | 968f7c0e65a293a7d7b9a87601e853894d9794ed (diff) | |
download | Qt-706c3f846b97c74c5e15395b6e2d306c522ba769.zip Qt-706c3f846b97c74c5e15395b6e2d306c522ba769.tar.gz Qt-706c3f846b97c74c5e15395b6e2d306c522ba769.tar.bz2 |
Optimisation for filtering events for gestures in graphics view.
We shouldn't add several graphicsobject contexts for the same gesture
type when looking for the gesture-enabled QGraphicsObject under a
hotspot.
Reviewed-by: Thomas Zander
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qgesturemanager.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index ed8e744..0601457 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -352,8 +352,10 @@ bool QGestureManager::filterEvent(QGraphicsObject *receiver, QEvent *event) for (ContextIterator it = item->QGraphicsItem::d_func()->gestureContext.begin(), e = item->QGraphicsItem::d_func()->gestureContext.end(); it != e; ++it) { if (it.value() == Qt::ItemWithChildrenGesture) { - if (!types.contains(it.key())) + if (!types.contains(it.key())) { + types.insert(it.key()); contexts.insertMulti(item, it.key()); + } } } item = item->parentObject(); |