diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index e2458f5..3296775 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -3042,74 +3042,6 @@ bool QGraphicsScene::event(QEvent *event) return true; } -<<<<<<< HEAD:src/gui/graphicsview/qgraphicsscene.cpp -======= -void QGraphicsScenePrivate::sendGestureEvent(const QSet<QGesture*> &gestures, const QSet<QString> &cancelled) -{ - Q_Q(QGraphicsScene); - typedef QMap<QGraphicsItem*, QSet<QGesture*> > ItemGesturesMap; - ItemGesturesMap itemGestures; - QSet<QGesture*> startedGestures; - for(QSet<QGesture*>::const_iterator it = gestures.begin(), e = gestures.end(); - it != e; ++it) { - QGesture *g = *it; - Q_ASSERT(g != 0); - QGesturePrivate *gd = g->d_func(); - if (gd->graphicsItem != 0) { - itemGestures[gd->graphicsItem].insert(g); - if (g->state() == Qt::GestureStarted || gd->singleshot) - startedGestures.insert(g); - } - } - - QSet<QGesture*> ignoredGestures; - for(ItemGesturesMap::const_iterator it = itemGestures.begin(), e = itemGestures.end(); - it != e; ++it) { - QGraphicsItem *receiver = it.key(); - Q_ASSERT(receiver != 0); - QGraphicsSceneGestureEvent event; - event.setGestures(it.value()); - event.setCancelledGestures(cancelled); - bool processed = sendEvent(receiver, &event); - QSet<QGesture*> started = startedGestures.intersect(it.value()); - if (event.isAccepted()) - foreach(QGesture *g, started) - g->accept(); - if (!started.isEmpty() && !(processed && event.isAccepted())) { - // there are started gestures event that weren't - // accepted, so propagating each gesture independently. - QSet<QGesture*>::const_iterator it = started.begin(), - e = started.end(); - for(; it != e; ++it) { - QGesture *g = *it; - if (processed && g->isAccepted()) { - continue; - } - QGesturePrivate *gd = g->d_func(); - QGraphicsItem *item = gd->graphicsItem; - Q_UNUSED(item); // ### REMOVE - gd->graphicsItem = 0; - - //### THIS IS BS, DONT FORGET TO REWRITE THIS CODE - // need to make sure we try to deliver event just once to each widget - const QString gestureType = g->type(); - QList<QGraphicsItem*> itemsUnderGesture = q->items(g->hotSpot()); - for (int i = 0; i < itemsUnderGesture.size(); ++i) { - QGraphicsItem *item = itemsUnderGesture.at(i); - if (item != receiver && item->d_func()->hasGesture(gestureType)) { - ignoredGestures.insert(g); - gd->graphicsItem = item; - break; - } - } - } - } - } - if (!ignoredGestures.isEmpty()) - sendGestureEvent(ignoredGestures, cancelled); -} - ->>>>>>> 296da87... Add QGraphicsView::filtersChildEvents property.:src/gui/graphicsview/qgraphicsscene.cpp /*! \reimp |