diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-07-10 14:42:08 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-07-10 15:02:23 (GMT) |
commit | 3384aea1357a0f2e7c633701f467d5f8b0855c50 (patch) | |
tree | 51017d746f571f65833c2fd70ca4a6a1aab49b1e /src | |
parent | c1cf0eb65e87386d1875ed309e5c13cdc0f33e3d (diff) | |
download | Qt-3384aea1357a0f2e7c633701f467d5f8b0855c50.zip Qt-3384aea1357a0f2e7c633701f467d5f8b0855c50.tar.gz Qt-3384aea1357a0f2e7c633701f467d5f8b0855c50.tar.bz2 |
Fixes broken item-lookup for untransformable items.
Found during manual testing (manualtests/graphicsview/untransformable).
At some point it was not possible to click on an untransformable item.
The problem was that none of the untransformable items were top-levels,
and none of the transformable top-level items were in the same area,
resulting in an empty list of estimated top-level items.
Auto-test included.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp b/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp index a7b4828..a54ade9 100644 --- a/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp +++ b/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp @@ -387,8 +387,13 @@ QList<QGraphicsItem *> QGraphicsSceneBspTreeIndexPrivate::estimateItems(const QR if (onlyTopLevelItems) { for (int i = 0; i < untransformableItems.size(); ++i) { QGraphicsItem *item = untransformableItems.at(i); - if (!item->d_ptr->parent) + if (!item->d_ptr->parent) { rectItems << item; + } else { + item = item->topLevelItem(); + if (!rectItems.contains(item)) + rectItems << item; + } } } else { rectItems += untransformableItems; |