summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativemousearea_p_p.h')
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea_p_p.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
index 67694fb..7248c92 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
@@ -70,6 +70,8 @@ public:
: absorb(true), hovered(false), pressed(false), longPress(false),
moved(false), stealMouse(false), doubleClick(false), preventStealing(false), drag(0)
{
+ Q_Q(QDeclarativeMouseArea);
+ forwardTo = QDeclarativeListProperty<QGraphicsObject>(q, forwardToList);
}
~QDeclarativeMouseAreaPrivate();
@@ -89,6 +91,18 @@ public:
lastModifiers = event->modifiers();
}
+ void forwardEvent(QGraphicsSceneMouseEvent* event)
+ {
+ Q_Q(QDeclarativeMouseArea);
+ for(int i=0; i < forwardToList.count(); i++){
+ event->setPos(forwardToList[i]->mapFromScene(event->scenePos()));
+ forwardToList[i]->scene()->sendEvent(forwardToList[i], event);
+ if(event->isAccepted())
+ break;
+ }
+ event->setPos(q->mapFromScene(event->scenePos()));
+ }
+
bool isPressAndHoldConnected() {
Q_Q(QDeclarativeMouseArea);
static int idx = QObjectPrivate::get(q)->signalIndex("pressAndHold(QDeclarativeMouseEvent*)");
@@ -121,6 +135,9 @@ public:
Qt::MouseButtons lastButtons;
Qt::KeyboardModifiers lastModifiers;
QBasicTimer pressAndHoldTimer;
+
+ QDeclarativeListProperty<QGraphicsObject> forwardTo;
+ QList<QGraphicsObject*> forwardToList;
};
QT_END_NAMESPACE