summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp')
-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");