summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp')
-rw-r--r--tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index 56b34fff2a..b9bbda766b 100644
--- a/tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -57,6 +57,7 @@ private slots:
void scale();
void shear();
void translate();
+ void createTextItem();
};
tst_QGraphicsItem::tst_QGraphicsItem()
@@ -230,5 +231,15 @@ void tst_QGraphicsItem::translate()
}
}
+void tst_QGraphicsItem::createTextItem()
+{
+ // Ensure QFontDatabase loaded the font beforehand
+ QFontInfo(qApp->font()).family();
+ const QString text = "This is some text";
+ QBENCHMARK {
+ QGraphicsTextItem item(text);
+ }
+}
+
QTEST_MAIN(tst_QGraphicsItem)
#include "tst_qgraphicsitem.moc"