summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-08-05 06:45:44 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-08-05 06:45:44 (GMT)
commitb008dfbd67176948f6fdf830dc99d23a538a6b9c (patch)
tree44c3ef55f019a0fae755fc54d42b1a95903ac027 /tests
parentb0470cd7553d26e73929bf9719eea9f49aeb6824 (diff)
downloadQt-b008dfbd67176948f6fdf830dc99d23a538a6b9c.zip
Qt-b008dfbd67176948f6fdf830dc99d23a538a6b9c.tar.gz
Qt-b008dfbd67176948f6fdf830dc99d23a538a6b9c.tar.bz2
Add benchmark for deleting an item with many children.
Task-number: 229124 Reviewed-by: TrustMe
Diffstat (limited to 'tests')
-rw-r--r--tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp
index 62a5b5c..ee27ebe 100644
--- a/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -27,6 +27,7 @@ public slots:
private slots:
void setParentItem();
void setParentItem_deep();
+ void deleteItemWithManyChildren();
void setPos_data();
void setPos();
void setTransform_data();
@@ -78,6 +79,16 @@ void tst_QGraphicsItem::setParentItem_deep()
}
}
+void tst_QGraphicsItem::deleteItemWithManyChildren()
+{
+ QBENCHMARK {
+ QGraphicsRectItem *rect = new QGraphicsRectItem;
+ for (int i = 0; i < 1000; ++i)
+ new QGraphicsRectItem(rect);
+ delete rect;
+ }
+}
+
void tst_QGraphicsItem::setPos_data()
{
QTest::addColumn<QPointF>("pos");