summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsview.cpp
diff options
context:
space:
mode:
authorLeonardo Sobral Cunha <leo.cunha@nokia.com>2009-09-18 14:26:43 (GMT)
committerLeonardo Sobral Cunha <leo.cunha@nokia.com>2009-09-22 15:08:47 (GMT)
commit6ad6dcd4c714dfff700029461638c235469f08d7 (patch)
tree1f0780cbeeb2b20e5a98fc772f6393fa9863aeb5 /src/gui/graphicsview/qgraphicsview.cpp
parent77b1f0ab8c8055835a3fc92d784d536efdc6acbf (diff)
downloadQt-6ad6dcd4c714dfff700029461638c235469f08d7.zip
Qt-6ad6dcd4c714dfff700029461638c235469f08d7.tar.gz
Qt-6ad6dcd4c714dfff700029461638c235469f08d7.tar.bz2
Inverts the SortOrder in graphics scene to reflect the stacking order
Inverted all references of Qt::AscendingiOrder <-> Qt::DescendingOrder to make the order parameter consistent with the stacking order, as stated in the docs. The graphics scene index was using the wrong ordering convention. Reviewed-by: andreas
Diffstat (limited to 'src/gui/graphicsview/qgraphicsview.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index b0829c5..98b2c9c 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -971,7 +971,7 @@ QList<QGraphicsItem *> QGraphicsViewPrivate::findItems(const QRegion &exposedReg
*allItems = true;
// All items are guaranteed within the exposed region.
- return scene->items(Qt::DescendingOrder);
+ return scene->items(Qt::AscendingOrder);
}
// Step 2) If the expose region is a simple rect and the view is only
@@ -981,7 +981,7 @@ QList<QGraphicsItem *> QGraphicsViewPrivate::findItems(const QRegion &exposedReg
if (simpleRectLookup) {
return scene->items(exposedRegionSceneBounds,
Qt::IntersectsItemBoundingRect,
- Qt::DescendingOrder, viewTransform);
+ Qt::AscendingOrder, viewTransform);
}
// If the region is complex or the view has a complex transform, adjust
@@ -993,7 +993,7 @@ QList<QGraphicsItem *> QGraphicsViewPrivate::findItems(const QRegion &exposedReg
const QPainterPath exposedScenePath(q->mapToScene(qt_regionToPath(adjustedRegion)));
return scene->items(exposedScenePath, Qt::IntersectsItemBoundingRect,
- Qt::DescendingOrder, viewTransform);
+ Qt::AscendingOrder, viewTransform);
}
/*!
@@ -2055,13 +2055,13 @@ QList<QGraphicsItem *> QGraphicsView::items(const QPoint &pos) const
QTransform xinv = viewportTransform().inverted();
return d->scene->items(xinv.mapRect(QRectF(pos.x(), pos.y(), 1, 1)),
Qt::IntersectsItemShape,
- Qt::AscendingOrder,
+ Qt::DescendingOrder,
viewportTransform());
}
// Use the polygon version
return d->scene->items(mapToScene(pos.x(), pos.y(), 1, 1),
Qt::IntersectsItemShape,
- Qt::AscendingOrder,
+ Qt::DescendingOrder,
viewportTransform());
}
@@ -2089,7 +2089,7 @@ QList<QGraphicsItem *> QGraphicsView::items(const QRect &rect, Qt::ItemSelection
Q_D(const QGraphicsView);
if (!d->scene)
return QList<QGraphicsItem *>();
- return d->scene->items(mapToScene(rect), mode, Qt::AscendingOrder, viewportTransform());
+ return d->scene->items(mapToScene(rect), mode, Qt::DescendingOrder, viewportTransform());
}
/*!
@@ -2117,7 +2117,7 @@ QList<QGraphicsItem *> QGraphicsView::items(const QPolygon &polygon, Qt::ItemSel
Q_D(const QGraphicsView);
if (!d->scene)
return QList<QGraphicsItem *>();
- return d->scene->items(mapToScene(polygon), mode, Qt::AscendingOrder, viewportTransform());
+ return d->scene->items(mapToScene(polygon), mode, Qt::DescendingOrder, viewportTransform());
}
/*!
@@ -2137,7 +2137,7 @@ QList<QGraphicsItem *> QGraphicsView::items(const QPainterPath &path, Qt::ItemSe
Q_D(const QGraphicsView);
if (!d->scene)
return QList<QGraphicsItem *>();
- return d->scene->items(mapToScene(path), mode, Qt::AscendingOrder, viewportTransform());
+ return d->scene->items(mapToScene(path), mode, Qt::DescendingOrder, viewportTransform());
}
/*!