From b4cf9c2e0520ec39ef064955ec025f5941e4c04a Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Wed, 1 Feb 2023 09:39:14 +0100 Subject: Replace uses of deprecated _qs with _s Pick-to: 6.4 6.5 Task-number: QTBUG-101408 Change-Id: Ie8a7944c3ded5662953bed00f022905f5805275e Reviewed-by: Allan Sandfeld Jensen --- tests/auto/pdfquick/multipageview/tst_multipageview.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp index 48cec928f..764a69959 100644 --- a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp +++ b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp @@ -12,6 +12,8 @@ #include #include "../shared/util.h" +using namespace Qt::StringLiterals; + Q_LOGGING_CATEGORY(lcTests, "qt.pdf.tests") class tst_MultiPageView : public QQuickDataTest @@ -257,7 +259,7 @@ void tst_MultiPageView::password() // actual QPdfDocument::pageCountChanged(int), for comparison with the illusory QQuickPdfDocument::pageCountChanged QVERIFY(extPageCountChangedSpy.isValid()); - QVERIFY(pdfView->setProperty("source", u"pdf-sample.protected.pdf"_qs)); + QVERIFY(pdfView->setProperty("source", u"pdf-sample.protected.pdf"_s)); QTRY_COMPARE(passwordRequiredSpy.size(), 1); qCDebug(lcTests) << "error while awaiting password" << doc->error() @@ -268,7 +270,7 @@ void tst_MultiPageView::password() QCOMPARE(extPageCountChangedSpy.size(), 0); QCOMPARE(statusChangedSpy.size(), 2); // Loading and then Error statusChangedSpy.clear(); - QVERIFY(doc->setProperty("password", u"Qt"_qs)); + QVERIFY(doc->setProperty("password", u"Qt"_s)); QCOMPARE(passwordChangedSpy.size(), 1); QTRY_COMPARE(doc->property("status").toInt(), int(QPdfDocument::Status::Ready)); qCDebug(lcTests) << "after setPassword" << doc->error() @@ -288,8 +290,8 @@ void tst_MultiPageView::selectionAndClipboard() QVERIFY(pdfView); QQuickPdfDocument *doc = pdfView->property("document").value(); QVERIFY(doc); - QVERIFY(doc->setProperty("password", u"Qt"_qs)); - QVERIFY(pdfView->setProperty("source", u"pdf-sample.protected.pdf"_qs)); + QVERIFY(doc->setProperty("password", u"Qt"_s)); + QVERIFY(pdfView->setProperty("source", u"pdf-sample.protected.pdf"_s)); QTRY_COMPARE(pdfView->property("currentPageRenderingStatus").toInt(), QQuickPdfPageImage::Ready); QVERIFY(QMetaObject::invokeMethod(pdfView, "selectAll")); @@ -316,8 +318,8 @@ void tst_MultiPageView::search() QTRY_COMPARE(pdfView->width(), 200); QQuickPdfDocument *doc = pdfView->property("document").value(); QVERIFY(doc); - QVERIFY(doc->setProperty("password", u"Qt"_qs)); - QVERIFY(pdfView->setProperty("source", u"pdf-sample.protected.pdf"_qs)); + QVERIFY(doc->setProperty("password", u"Qt"_s)); + QVERIFY(pdfView->setProperty("source", u"pdf-sample.protected.pdf"_s)); QTRY_COMPARE(pdfView->property("currentPageRenderingStatus").toInt(), QQuickPdfPageImage::Ready); QPdfSearchModel *searchModel = pdfView->property("searchModel").value(); QVERIFY(searchModel); @@ -328,7 +330,7 @@ void tst_MultiPageView::search() QObject *multiline = findFirstChild(firstPage, "QQuickPathMultiline"); QVERIFY(multiline); - pdfView->setProperty("searchString", u"PDF"_qs); + pdfView->setProperty("searchString", u"PDF"_s); QTRY_COMPARE(searchModel->rowCount(QModelIndex()), 7); // occurrences of the word "PDF" in this file const int count = searchModel->rowCount(QModelIndex()); QList> resultOutlines = multiline->property("paths").value>>(); -- cgit v1.2.1