diff options
Diffstat (limited to 'tests/benchmarks/qml/creation/tst_creation.cpp')
-rw-r--r-- | tests/benchmarks/qml/creation/tst_creation.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/benchmarks/qml/creation/tst_creation.cpp b/tests/benchmarks/qml/creation/tst_creation.cpp index fa94fd4d46..ca5802a8e7 100644 --- a/tests/benchmarks/qml/creation/tst_creation.cpp +++ b/tests/benchmarks/qml/creation/tst_creation.cpp @@ -102,6 +102,12 @@ public: tst_creation::tst_creation() { qmlRegisterType<TestType>("Qt.test", 1, 0, "TestType"); + + // Ensure QtQuick is loaded and imported. Some benchmark like elements() rely on QQmlMetaType::qmlTypeNames() to + // be populated. + QQmlComponent component(&engine); + component.setData("import QtQuick 2.0\nItem{}", QUrl()); + QScopedPointer<QObject> obj(component.create()); } inline QUrl TEST_FILE(const QString &filename) |