diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-03-21 10:21:18 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-04-29 09:47:43 +0200 |
commit | 2c9c1590e6c9dc59bd786f4b41af32f1994bed2d (patch) | |
tree | 7cc1302426732093f1c88c1d7621a95854ade0e2 /tests/auto/qml/qqmllistmodel | |
parent | ecc87ea07723998dcfa947353e4259ec8d057035 (diff) |
Replace uses of deprecated _qs with _s/QStringLiteral
Task-number: QTBUG-101408
Change-Id: Ic925751b73f52d8fa5add5cacc52d6dd6ea2dc27
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmllistmodel')
-rw-r--r-- | tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp index 09949dd610..830b7228f7 100644 --- a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp +++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp @@ -41,6 +41,8 @@ #include <QtQuickTestUtils/private/qmlutils_p.h> +using namespace Qt::StringLiterals; + Q_DECLARE_METATYPE(QList<int>) Q_DECLARE_METATYPE(QList<QVariantHash>) @@ -1777,7 +1779,7 @@ void tst_qqmllistmodel::objectDestroyed() std::unique_ptr<QObject> obj = std::make_unique<QObject>(); connect(obj.get(), &QObject::destroyed, [&]() { obj.release(); }); - engine.rootContext()->setContextProperty(u"contextObject"_qs, obj.get()); + engine.rootContext()->setContextProperty(u"contextObject"_s, obj.get()); engine.setObjectOwnership(obj.get(), QJSEngine::JavaScriptOwnership); delete component.create(); @@ -1785,7 +1787,7 @@ void tst_qqmllistmodel::objectDestroyed() engine.collectGarbage(); QTest::qSleep(250); QVERIFY(obj); - engine.evaluate(u"model.clear();"_qs); + engine.evaluate(u"model.clear();"_s); engine.collectGarbage(); QTRY_VERIFY(!obj); } @@ -1803,7 +1805,7 @@ void tst_qqmllistmodel::destroyObject() QUrl()); QVERIFY2(component.isReady(), qPrintable(component.errorString())); QScopedPointer<QObject> element(new QObject); - engine.rootContext()->setContextProperty(u"contextObject"_qs, element.data()); + engine.rootContext()->setContextProperty(u"contextObject"_s, element.data()); QScopedPointer<QObject> o(component.create()); QVERIFY(!o.isNull()); |