aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickpainteditem.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@sletta.org>2014-09-02 11:49:50 +0200
committerGunnar Sletta <gunnar@sletta.org>2014-09-03 09:16:14 +0200
commit0de680c8e8fab36e386dca35e5008ffaa27e8ef6 (patch)
tree36ef99752bd8f255d89d9a6f3635655dd857e94e /src/quick/items/qquickpainteditem.cpp
parent978ecab8b5dc20384cb449e05d58293f96722c0e (diff)
Fix performance regression caused by SG signals in QQuickItem.
For a testcase with thosands of items, I measured an increase in shutdown time from 800ms to 7500ms, all spent in disconnect(). This is not acceptible, so we're choosing a different approach. If items implement a invalidateSceneGraph slot, this function will be called during shutdown. It should be made a proper virtual in Qt 6. This approach costs very little. Change-Id: I5970143cc0a0744955687e17586f0bb00c9afb26 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/quick/items/qquickpainteditem.cpp')
-rw-r--r--src/quick/items/qquickpainteditem.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp
index bc148c5bca..a79f0b523c 100644
--- a/src/quick/items/qquickpainteditem.cpp
+++ b/src/quick/items/qquickpainteditem.cpp
@@ -140,7 +140,6 @@ QQuickPaintedItem::QQuickPaintedItem(QQuickItem *parent)
: QQuickItem(*(new QQuickPaintedItemPrivate), parent)
{
setFlag(ItemHasContents);
- connect(this, SIGNAL(sceneGraphInvalidated()), this, SLOT(invalidateSG()));
}
/*!
@@ -150,7 +149,6 @@ QQuickPaintedItem::QQuickPaintedItem(QQuickPaintedItemPrivate &dd, QQuickItem *p
: QQuickItem(dd, parent)
{
setFlag(ItemHasContents);
- connect(this, SIGNAL(sceneGraphInvalidated()), this, SLOT(invalidateSG()));
}
/*!
@@ -561,7 +559,7 @@ void QQuickPaintedItem::releaseResources()
d->node = 0; // Managed by the scene graph, just clear the pointer.
}
-void QQuickPaintedItem::invalidateSG()
+void QQuickPaintedItem::invalidateSceneGraph()
{
Q_D(QQuickPaintedItem);
delete d->textureProvider;