Port away from deprecated _qs UDL
Use Qt::StringLiterals::_s instead. Also reflow lines because stricter /Zc options coming in from a qtbase update make MSVS barf on line-broken u"" ""_s expressions. Change-Id: I95a2a3d878d2ac506d9c54bbdeb734cf5d94bb8b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
6f64675384
commit
b30a49f2c6
|
@ -6,6 +6,8 @@
|
||||||
#include <QtQml/qqmlextensionplugin.h>
|
#include <QtQml/qqmlextensionplugin.h>
|
||||||
#include <QtQuickControls2/qquickstyle.h>
|
#include <QtQuickControls2/qquickstyle.h>
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
@ -13,7 +15,7 @@ int main(int argc, char *argv[])
|
||||||
QQuickStyle::setStyle("iOS");
|
QQuickStyle::setStyle("iOS");
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
const QUrl url(u"qrc:/main.qml"_qs);
|
const QUrl url(u"qrc:/main.qml"_s);
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
&engine, &QQmlApplicationEngine::objectCreated, &app,
|
&engine, &QQmlApplicationEngine::objectCreated, &app,
|
||||||
[url](QObject *obj, const QUrl &objUrl) {
|
[url](QObject *obj, const QUrl &objUrl) {
|
||||||
|
|
|
@ -11,6 +11,8 @@ Q_IMPORT_QML_PLUGIN(duck_tickPlugin)
|
||||||
Q_IMPORT_QML_PLUGIN(duck_trickPlugin)
|
Q_IMPORT_QML_PLUGIN(duck_trickPlugin)
|
||||||
Q_IMPORT_QML_PLUGIN(duck_trackPlugin)
|
Q_IMPORT_QML_PLUGIN(duck_trackPlugin)
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
class test : public QObject
|
class test : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -22,7 +24,7 @@ void test::test_loadable()
|
||||||
{
|
{
|
||||||
QQmlEngine engine;
|
QQmlEngine engine;
|
||||||
engine.addImportPath(QStringLiteral(":/"));
|
engine.addImportPath(QStringLiteral(":/"));
|
||||||
QQmlComponent c(&engine, QUrl(u"qrc:/duck/main.qml"_qs));
|
QQmlComponent c(&engine, QUrl(u"qrc:/duck/main.qml"_s));
|
||||||
QVERIFY2(c.isReady(), qPrintable(c.errorString()));
|
QVERIFY2(c.isReady(), qPrintable(c.errorString()));
|
||||||
QScopedPointer<QObject> o(c.create());
|
QScopedPointer<QObject> o(c.create());
|
||||||
QVERIFY(!o.isNull());
|
QVERIFY(!o.isNull());
|
||||||
|
|
|
@ -424,13 +424,11 @@ void tst_QmllsCompletions::function_documentations()
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QVERIFY2(c.detail == details,
|
QVERIFY2(c.detail == details,
|
||||||
qPrintable(u"Completion item '%1' has wrong "
|
qPrintable(u"Completion item '%1' has wrong details '%2'"_s
|
||||||
"details '%2'"_qs.arg(label)
|
.arg(label).arg(*c.detail)));
|
||||||
.arg(*c.detail)));
|
|
||||||
QVERIFY2(cDoc == docs,
|
QVERIFY2(cDoc == docs,
|
||||||
qPrintable(u"Completion item '%1' has wrong "
|
qPrintable(u"Completion item '%1' has wrong documentation '%2'"_s
|
||||||
"documentation '%2'"_qs.arg(label)
|
.arg(label).arg(cDoc)));
|
||||||
.arg(cDoc)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clean();
|
clean();
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
using namespace QLspSpecification;
|
using namespace QLspSpecification;
|
||||||
|
|
||||||
class DiagnosticsHandler
|
class DiagnosticsHandler
|
||||||
|
@ -127,8 +128,8 @@ void tst_Qmlls::initTestCase()
|
||||||
tDoc.publishDiagnostics = pDiag;
|
tDoc.publishDiagnostics = pDiag;
|
||||||
pDiag.versionSupport = true;
|
pDiag.versionSupport = true;
|
||||||
clientInfo.capabilities.textDocument = tDoc;
|
clientInfo.capabilities.textDocument = tDoc;
|
||||||
QJsonObject workspace({ { u"didChangeWatchedFiles"_qs,
|
QJsonObject workspace({ { u"didChangeWatchedFiles"_s,
|
||||||
QJsonObject({ { u"dynamicRegistration"_qs, true } }) } });
|
QJsonObject({ { u"dynamicRegistration"_s, true } }) } });
|
||||||
clientInfo.capabilities.workspace = workspace;
|
clientInfo.capabilities.workspace = workspace;
|
||||||
bool didInit = false;
|
bool didInit = false;
|
||||||
m_protocol.registerRegistrationRequestHandler([this](const QByteArray &,
|
m_protocol.registerRegistrationRequestHandler([this](const QByteArray &,
|
||||||
|
|
Loading…
Reference in New Issue