22 #ifndef MOUSEEVENTEATER_H
23 #define MOUSEEVENTEATER_H
25 #include <QApplication>
26 #include <QGraphicsSceneMouseEvent>
27 #include <QMouseEvent>
43 #if defined(TARGET_DESKTOP)
44 bool insideGestureStrip(
false);
46 static QString gestureStrip(
"GestureStrip");
47 QString objectClassName(o->metaObject()->className());
49 if (objectClassName == gestureStrip) {
50 insideGestureStrip =
true;
51 }
else if (o->parent()) {
52 QString parentClassName(o->parent()->metaObject()->className());
53 if (parentClassName == gestureStrip) {
54 insideGestureStrip =
true;
58 if (insideGestureStrip) {
69 if (e->type() == QEvent::MouseButtonRelease ||
70 e->type() == QEvent::MouseButtonPress ||
71 e->type() == QEvent::MouseButtonDblClick ||
72 e->type() == QEvent::MouseMove) {
73 QMouseEvent *me =
static_cast<QMouseEvent *
>(e);
74 HostInfo info = HostBase::instance()->getInfo();
76 QWidget *w = QApplication::activeWindow();
79 frameHeight = w->frameGeometry().height() -
80 w->geometry().height();
86 if (me->pos().y() < (info.displayHeight + frameHeight)) {
88 QPointF pos(me->pos());
90 QGraphicsSceneMouseEvent *
event = 0;
92 if (me->type() == QEvent::MouseButtonPress) {
93 event =
new QGraphicsSceneMouseEvent(QEvent::GraphicsSceneMousePress);
94 }
else if (me->type() == QEvent::MouseButtonRelease) {
95 event =
new QGraphicsSceneMouseEvent(QEvent::GraphicsSceneMouseRelease);
96 }
else if (me->type() == QEvent::MouseButtonDblClick) {
97 event =
new QGraphicsSceneMouseEvent(QEvent::GraphicsSceneMouseDoubleClick);
98 }
else if (me->type() == QEvent::MouseMove) {
99 event =
new QGraphicsSceneMouseEvent(QEvent::GraphicsSceneMouseMove);
103 event->setScenePos(pos);
104 event->setScreenPos(me->globalPos());
105 event->setButton(me->button());
106 event->setButtons(me->buttons());
107 event->setModifiers(me->modifiers());
108 handled = QApplication::sendEvent(scene, event);