summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsproxywidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/graphicsview/qgraphicsproxywidget.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsproxywidget.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsproxywidget.cpp b/src/gui/graphicsview/qgraphicsproxywidget.cpp
index 57269ce..1f3637d 100644
--- a/src/gui/graphicsview/qgraphicsproxywidget.cpp
+++ b/src/gui/graphicsview/qgraphicsproxywidget.cpp
@@ -48,6 +48,7 @@
#include "private/qgraphicsproxywidget_p.h"
#include "private/qwidget_p.h"
#include "private/qapplication_p.h"
+#include "private/qgesturemanager_p.h"
#include <QtCore/qdebug.h>
#include <QtGui/qevent.h>
@@ -275,7 +276,7 @@ void QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(QGraphicsSceneMouseEvent
QWidget *embeddedMouseGrabberPtr = (QWidget *)embeddedMouseGrabber;
QApplicationPrivate::sendMouseEvent(receiver, mouseEvent, alienWidget, widget,
- &embeddedMouseGrabberPtr, lastWidgetUnderMouse);
+ &embeddedMouseGrabberPtr, lastWidgetUnderMouse, event->spontaneous());
embeddedMouseGrabber = embeddedMouseGrabberPtr;
// Handle enter/leave events when last button is released from mouse
@@ -648,6 +649,9 @@ void QGraphicsProxyWidgetPrivate::setWidget_helper(QWidget *newWidget, bool auto
q->setAttribute(Qt::WA_OpaquePaintEvent);
widget = newWidget;
+ foreach(int gestureId, widget->d_func()->gestures) {
+ grabGesture(gestureId);
+ }
// Changes only go from the widget to the proxy.
enabledChangeMode = QGraphicsProxyWidgetPrivate::WidgetToProxyMode;
@@ -871,6 +875,16 @@ bool QGraphicsProxyWidget::event(QEvent *event)
}
break;
}
+ case QEvent::GraphicsSceneGesture: {
+ qDebug() << "QGraphicsProxyWidget: graphicsscenegesture";
+ if (d->widget && d->widget->isVisible()) {
+ QGraphicsSceneGestureEvent *ge = static_cast<QGraphicsSceneGestureEvent*>(event);
+ //### TODO: widget->childAt(): decompose gesture event and find widget under hotspots.
+ //QGestureManager::instance()->sendGestureEvent(d->widget, ge->gestures().toSet(), ge->cancelledGestures());
+ return true;
+ }
+ break;
+ }
default:
break;
}