summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-02-21 16:16:18 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-02-21 16:16:18 (GMT)
commitfe1a44a850e61d8b64626424b45ef7592ec66589 (patch)
tree5cceb6849ddebd37f3098664c52bdb629543cca1 /src/gui/graphicsview
parentef01812875f0dfc8e032fefb90f1afeb57aaa821 (diff)
parent2181a341839b72a627a7ef641de58d1d2411f123 (diff)
downloadQt-fe1a44a850e61d8b64626424b45ef7592ec66589.zip
Qt-fe1a44a850e61d8b64626424b45ef7592ec66589.tar.gz
Qt-fe1a44a850e61d8b64626424b45ef7592ec66589.tar.bz2
Merge branch 'master' of git:qt/qt
Conflicts: doc/src/declarative/advtutorial1.qdoc doc/src/declarative/advtutorial2.qdoc doc/src/declarative/advtutorial3.qdoc doc/src/declarative/advtutorial4.qdoc doc/src/declarative/tutorial1.qdoc doc/src/declarative/tutorial2.qdoc doc/src/declarative/tutorial3.qdoc
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp30
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp33
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp4
3 files changed, 45 insertions, 22 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 54914b3..ca20101 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -357,19 +357,22 @@
default, child items are stacked on top of the parent item. But setting
this flag, the child will be stacked behind it. This flag is useful for
drop shadow effects and for decoration objects that follow the parent
- item's geometry without drawing on top of it.
+ item's geometry without drawing on top of it. This flag was introduced
+ in Qt 4.5.
\value ItemUsesExtendedStyleOption The item makes use of either
- \l{QStyleOptionGraphicsItem::}{exposedRect} or
- \l{QStyleOptionGraphicsItem::}{matrix} in QStyleOptionGraphicsItem. By default,
- the \l{QStyleOptionGraphicsItem::}{exposedRect} is initialized to the item's
- boundingRect() and the \l{QStyleOptionGraphicsItem::}{matrix} is untransformed.
- You can enable this flag for the style options to be set up with more
- fine-grained values.
- Note that QStyleOptionGraphicsItem::levelOfDetail is unaffected by this flag
+ \l{QStyleOptionGraphicsItem::} {exposedRect} or
+ \l{QStyleOptionGraphicsItem::} {matrix} in
+ QStyleOptionGraphicsItem. By default, the
+ \l{QStyleOptionGraphicsItem::} {exposedRect} is initialized to the
+ item's boundingRect() and the
+ \l{QStyleOptionGraphicsItem::}{matrix} is untransformed. You can
+ enable this flag for the style options to be set up with more
+ fine-grained values. Note that
+ QStyleOptionGraphicsItem::levelOfDetail is unaffected by this flag
and always initialized to 1. Use
- QStyleOptionGraphicsItem::levelOfDetailFromTransform() if you need a higher
- value.
+ QStyleOptionGraphicsItem::levelOfDetailFromTransform() if you need
+ a higher value. This flag was introduced in Qt 4.6.
\value ItemHasNoContents The item does not paint anything (i.e., calling
paint() on the item has no effect). You should set this flag on items that
@@ -387,9 +390,10 @@
used for Asian languages.
This flag was introduced in Qt 4.6.
- \value ItemNegativeZStacksBehindParent The item automatically stacks behind
- it's parent if it's z-value is negative. This flag enables setZValue() to
- toggle ItemStacksBehindParent.
+ \value ItemNegativeZStacksBehindParent The item automatically
+ stacks behind it's parent if it's z-value is negative. This flag
+ enables setZValue() to toggle ItemStacksBehindParent. This flag
+ was introduced in Qt 4.6.
\value ItemIsPanel The item is a panel. A panel provides activation and
contained focus handling. Only one panel can be active at a time (see
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 3280e86..aaae88e 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -5134,6 +5134,8 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool
}
/*!
+ \obsolete
+
Paints the given \a items using the provided \a painter, after the
background has been drawn, and before the foreground has been
drawn. All painting is done in \e scene coordinates. Before
@@ -5156,7 +5158,7 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool
\snippet doc/src/snippets/graphicssceneadditemsnippet.cpp 0
- \obsolete Since Qt 4.6, this function is not called anymore unless
+ Since Qt 4.6, this function is not called anymore unless
the QGraphicsView::IndirectPainting flag is given as an Optimization
flag.
@@ -5712,8 +5714,15 @@ void QGraphicsScenePrivate::touchEventHandler(QTouchEvent *sceneTouchEvent)
item->d_ptr->acceptedTouchBeginEvent = true;
bool res = sendTouchBeginEvent(item, &touchEvent)
&& touchEvent.isAccepted();
- if (!res)
+ if (!res) {
+ // forget about these touch points, we didn't handle them
+ for (int i = 0; i < touchEvent.touchPoints().count(); ++i) {
+ const QTouchEvent::TouchPoint &touchPoint = touchEvent.touchPoints().at(i);
+ itemForTouchPointId.remove(touchPoint.id());
+ sceneCurrentTouchPoints.remove(touchPoint.id());
+ }
ignoreSceneTouchEvent = false;
+ }
break;
}
default:
@@ -5904,13 +5913,21 @@ void QGraphicsScenePrivate::getGestureTargets(const QSet<QGesture *> &gestures,
QList<QGraphicsItem *> items = itemsAtPosition(screenPos, QPointF(), viewport);
QList<QGraphicsObject *> result;
for (int j = 0; j < items.size(); ++j) {
- QGraphicsObject *item = items.at(j)->toGraphicsObject();
- if (!item)
- continue;
- QGraphicsItemPrivate *d = item->QGraphicsItem::d_func();
- if (d->gestureContext.contains(gestureType)) {
- result.append(item);
+ QGraphicsItem *item = items.at(j);
+
+ // Check if the item is blocked by a modal panel and use it as
+ // a target instead of this item.
+ (void) item->isBlockedByModalPanel(&item);
+
+ if (QGraphicsObject *itemobj = item->toGraphicsObject()) {
+ QGraphicsItemPrivate *d = item->d_func();
+ if (d->gestureContext.contains(gestureType)) {
+ result.append(itemobj);
+ }
}
+ // Don't propagate through panels.
+ if (item->isPanel())
+ break;
}
DEBUG() << "QGraphicsScenePrivate::getGestureTargets:"
<< gesture << result;
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index 96b9373..06b7438 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -3609,6 +3609,8 @@ void QGraphicsView::drawForeground(QPainter *painter, const QRectF &rect)
}
/*!
+ \obsolete
+
Draws the items \a items in the scene using \a painter, after the
background and before the foreground are drawn. \a numItems is the number
of items in \a items and options in \a options. \a options is a list of
@@ -3617,7 +3619,7 @@ void QGraphicsView::drawForeground(QPainter *painter, const QRectF &rect)
The default implementation calls the scene's drawItems() function.
- \obsolete Since Qt 4.6, this function is not called anymore unless
+ Since Qt 4.6, this function is not called anymore unless
the QGraphicsView::IndirectPainting flag is given as an Optimization
flag.