summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-05-24 04:35:17 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-05-24 04:35:17 (GMT)
commit79446ca4e047e68bea68aef902a5d48478bcc9cc (patch)
tree3ad3a96ea51babc0cf7c5a8f340feafc083ce028 /src/gui/graphicsview
parentff27b0e6a7161db17335dc4aa8724cae75cec39c (diff)
downloadQt-79446ca4e047e68bea68aef902a5d48478bcc9cc.zip
Qt-79446ca4e047e68bea68aef902a5d48478bcc9cc.tar.gz
Qt-79446ca4e047e68bea68aef902a5d48478bcc9cc.tar.bz2
Don't polish QDeclarativeItems.
Avoids unnecessary processing and assumptions we would not want to preserve in the future. Task-number: QTBUG-10217 Reviewed-by: Martin Jones
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 344df30..ae0abf9 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -2545,12 +2545,16 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
return;
}
- if (d->unpolishedItems.isEmpty()) {
- QMetaMethod method = metaObject()->method(d->polishItemsIndex);
- method.invoke(this, Qt::QueuedConnection);
+ // QDeclarativeItems do not rely on initial itemChanged message, as the componentComplete
+ // function allows far more opportunity for delayed-construction optimization.
+ if (!item->d_ptr->isDeclarativeItem) {
+ if (d->unpolishedItems.isEmpty()) {
+ QMetaMethod method = metaObject()->method(d->polishItemsIndex);
+ method.invoke(this, Qt::QueuedConnection);
+ }
+ d->unpolishedItems.append(item);
+ item->d_ptr->pendingPolish = true;
}
- d->unpolishedItems.append(item);
- item->d_ptr->pendingPolish = true;
// Detach this item from its parent if the parent's scene is different
// from this scene.