summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-07-01 11:59:17 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-07-01 12:00:03 (GMT)
commit5f9758295715c088c23f51d294b2b1b0fb361872 (patch)
tree65d8c9fbf8804bcc681c513616ccf16174b442d7 /src/gui/graphicsview
parent574fdf0b7e61c1c9994739035d9adb51af2629d0 (diff)
parentd43a10d6d9a5f13fc8deac052926720927e09e83 (diff)
downloadQt-5f9758295715c088c23f51d294b2b1b0fb361872.zip
Qt-5f9758295715c088c23f51d294b2b1b0fb361872.tar.gz
Qt-5f9758295715c088c23f51d294b2b1b0fb361872.tar.bz2
Merge commit 'qt/master' into graphicssceneindex
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsproxywidget.cpp1
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp30
-rw-r--r--src/gui/graphicsview/qgraphicsscene.h2
4 files changed, 33 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 6850b5f..002eab9 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -6322,6 +6322,8 @@ void QGraphicsItem::releaseGesture(int gestureId)
*/
void QGraphicsItem::setGestureEnabled(int gestureId, bool enable)
{
+ Q_UNUSED(gestureId);
+ Q_UNUSED(enable);
//###
}
diff --git a/src/gui/graphicsview/qgraphicsproxywidget.cpp b/src/gui/graphicsview/qgraphicsproxywidget.cpp
index ab94679..f081222 100644
--- a/src/gui/graphicsview/qgraphicsproxywidget.cpp
+++ b/src/gui/graphicsview/qgraphicsproxywidget.cpp
@@ -878,7 +878,6 @@ bool QGraphicsProxyWidget::event(QEvent *event)
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;
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 1263c3a..9de6598 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -3109,7 +3109,6 @@ void QGraphicsScenePrivate::sendGestureEvent(const QSet<QGesture*> &gestures, co
continue;
}
QGesturePrivate *gd = g->d_func();
- QGraphicsItem *item = gd->graphicsItem;
gd->graphicsItem = 0;
//### THIS IS BS, DONT FORGET TO REWRITE THIS CODE
@@ -4975,6 +4974,34 @@ void QGraphicsScene::setActiveWindow(QGraphicsWidget *widget)
}
}
+/*!
+ \since 4.6
+
+ Sends event \a event to item \a item through possible event filters.
+
+ The event is sent only if the item is enabled.
+
+ Returns \c false if the event was filtered or if the item is disabled.
+ Otherwise returns the value that was returned from the event handler.
+
+ \sa QGraphicsItem::sceneEvent(), QGraphicsItem::sceneEventFilter()
+*/
+bool QGraphicsScene::sendEvent(QGraphicsItem *item, QEvent *event)
+{
+ Q_D(QGraphicsScene);
+ if (!item) {
+ qWarning("QGraphicsScene::sendEvent: cannot send event to a null item");
+ return false;
+ }
+ if (item->scene() != this) {
+ qWarning("QGraphicsScene::sendEvent: item %p's scene (%p)"
+ " is different from this scene (%p)",
+ item, item->scene(), this);
+ return false;
+ }
+ return d->sendEvent(item, event);
+}
+
void QGraphicsScenePrivate::addView(QGraphicsView *view)
{
views << view;
@@ -5001,6 +5028,7 @@ void QGraphicsScenePrivate::grabGesture(QGraphicsItem *item, int gestureId)
void QGraphicsScenePrivate::releaseGesture(QGraphicsItem *item, int gestureId)
{
+ Q_UNUSED(gestureId);
itemsWithGestures.remove(item);
//###
}
diff --git a/src/gui/graphicsview/qgraphicsscene.h b/src/gui/graphicsview/qgraphicsscene.h
index 8329942..7eaa202 100644
--- a/src/gui/graphicsview/qgraphicsscene.h
+++ b/src/gui/graphicsview/qgraphicsscene.h
@@ -246,6 +246,8 @@ public:
QGraphicsWidget *activeWindow() const;
void setActiveWindow(QGraphicsWidget *widget);
+ bool sendEvent(QGraphicsItem *item, QEvent *event);
+
public Q_SLOTS:
void update(const QRectF &rect = QRectF());
void invalidate(const QRectF &rect = QRectF(), SceneLayers layers = AllLayers);