summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscene.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2010-01-08 08:22:10 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2010-01-08 08:22:10 (GMT)
commit6e99e7c7d772e122b0e515c1613d9a1e427181ad (patch)
tree08ba4a1db8d17bffa2a69a0538298818668e50fd /src/gui/graphicsview/qgraphicsscene.cpp
parent751de8211033b40c66d88140137eef76e6b20cfa (diff)
parent118e7a807d0764dee97612589fe5d7072d271e1e (diff)
downloadQt-6e99e7c7d772e122b0e515c1613d9a1e427181ad.zip
Qt-6e99e7c7d772e122b0e515c1613d9a1e427181ad.tar.gz
Qt-6e99e7c7d772e122b0e515c1613d9a1e427181ad.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6
Conflicts: src/multimedia/audio/qaudioformat.cpp
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 034d1f7..5c6a8ae 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -292,6 +292,7 @@ QGraphicsScenePrivate::QGraphicsScenePrivate()
processDirtyItemsEmitted(false),
selectionChanging(0),
needSortTopLevelItems(true),
+ unpolishedItemsModified(true),
holesInTopLevelSiblingIndex(false),
topLevelSequentialOrdering(true),
scenePosDescendantsUpdatePending(false),
@@ -428,12 +429,12 @@ void QGraphicsScenePrivate::unregisterTopLevelItem(QGraphicsItem *item)
*/
void QGraphicsScenePrivate::_q_polishItems()
{
- QSet<QGraphicsItem *>::Iterator it;
+ QSet<QGraphicsItem *>::Iterator it = unpolishedItems.begin();
const QVariant booleanTrueVariant(true);
while (!unpolishedItems.isEmpty()) {
- it = unpolishedItems.begin();
QGraphicsItem *item = *it;
- unpolishedItems.erase(it);
+ it = unpolishedItems.erase(it);
+ unpolishedItemsModified = false;
if (!item->d_ptr->explicitlyHidden) {
item->itemChange(QGraphicsItem::ItemVisibleChange, booleanTrueVariant);
item->itemChange(QGraphicsItem::ItemVisibleHasChanged, booleanTrueVariant);
@@ -442,6 +443,8 @@ void QGraphicsScenePrivate::_q_polishItems()
QEvent event(QEvent::Polish);
QApplication::sendEvent((QGraphicsWidget *)item, &event);
}
+ if (unpolishedItemsModified)
+ it = unpolishedItems.begin();
}
}
@@ -636,6 +639,7 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
hoverItems.removeAll(item);
cachedItemsUnderMouse.removeAll(item);
unpolishedItems.remove(item);
+ unpolishedItemsModified = true;
resetDirtyItem(item);
//We remove all references of item from the sceneEventFilter arrays
@@ -2578,9 +2582,10 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
item->d_ptr->resolveFont(d->font.resolve());
item->d_ptr->resolvePalette(d->palette.resolve());
- if (d->unpolishedItems.isEmpty())
- QMetaObject::invokeMethod(this, "_q_polishItems", Qt::QueuedConnection);
- d->unpolishedItems.insert(item);
+ if (d->unpolishedItems.isEmpty())
+ QMetaObject::invokeMethod(this, "_q_polishItems", Qt::QueuedConnection);
+ d->unpolishedItems.insert(item);
+ d->unpolishedItemsModified = true;
// Reenable selectionChanged() for individual items
--d->selectionChanging;