diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-12-22 00:53:10 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-12-22 00:53:10 (GMT) |
commit | 98689a1e630f1cd51d1306993f7179371c8bdbb7 (patch) | |
tree | 00a551086eb1e7fd5928694cd79574bd5221c644 /tests/benchmarks/declarative/creation | |
parent | f16ea3dcd03f3ffe47483e2f852d104e5c68d475 (diff) | |
download | Qt-98689a1e630f1cd51d1306993f7179371c8bdbb7.zip Qt-98689a1e630f1cd51d1306993f7179371c8bdbb7.tar.gz Qt-98689a1e630f1cd51d1306993f7179371c8bdbb7.tar.bz2 |
benchmark
Diffstat (limited to 'tests/benchmarks/declarative/creation')
-rw-r--r-- | tests/benchmarks/declarative/creation/tst_creation.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/benchmarks/declarative/creation/tst_creation.cpp b/tests/benchmarks/declarative/creation/tst_creation.cpp index 61033e2..ae50309 100644 --- a/tests/benchmarks/declarative/creation/tst_creation.cpp +++ b/tests/benchmarks/declarative/creation/tst_creation.cpp @@ -65,7 +65,9 @@ private slots: void objects_qmltype(); void qgraphicsitem(); - void qgraphicsitem_tree(); + void qgraphicsobject(); + void qgraphicsitem14(); + void qgraphicsitem_tree14(); void itemtree_notree_cpp(); void itemtree_objtree_cpp(); @@ -169,9 +171,32 @@ public: virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) {} }; +class QGraphicsObjectDummy : public QGraphicsObject +{ +public: + virtual QRectF boundingRect() const { return QRectF(); } + virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) {} +}; + void tst_creation::qgraphicsitem() { QBENCHMARK { + QGraphicsItemDummy *i = new QGraphicsItemDummy(); + delete i; + } +} + +void tst_creation::qgraphicsobject() +{ + QBENCHMARK { + QGraphicsObjectDummy *i = new QGraphicsObjectDummy(); + delete i; + } +} + +void tst_creation::qgraphicsitem14() +{ + QBENCHMARK { QGraphicsItemDummy *i1 = new QGraphicsItemDummy(); QGraphicsItemDummy *i2 = new QGraphicsItemDummy(); QGraphicsItemDummy *i3 = new QGraphicsItemDummy(); @@ -204,7 +229,7 @@ void tst_creation::qgraphicsitem() } } -void tst_creation::qgraphicsitem_tree() +void tst_creation::qgraphicsitem_tree14() { QBENCHMARK { // i1 |