From df779e0e743020d53c4bf629d781851714e26552 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Tue, 11 Jun 2019 19:38:28 +0200 Subject: Replace QLatin1Literal with QLatin1String QLatin1Literal is an undocumented and deprecated typedef for QLatin1String, just use the original. Change-Id: Id6a813ed5c0a457f003dbd118b64f77d9d82cb13 Reviewed-by: Paul Lemire --- src/core/aspects/qaspectengine.cpp | 4 +-- src/extras/defaults/qt3dwindow.cpp | 2 +- .../quick3drender/items/quick3draycaster.cpp | 38 +++++++++++----------- src/render/backend/cameralens.cpp | 6 ++-- src/render/backend/rendersettings.cpp | 2 +- src/render/frontend/qcameralens.cpp | 6 ++-- .../auto/core/qaspectengine/tst_qaspectengine.cpp | 2 +- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/core/aspects/qaspectengine.cpp b/src/core/aspects/qaspectengine.cpp index 3f219597e..222c4c2af 100644 --- a/src/core/aspects/qaspectengine.cpp +++ b/src/core/aspects/qaspectengine.cpp @@ -381,9 +381,9 @@ QVariant QAspectEngine::executeCommand(const QString &command) { Q_D(QAspectEngine); - if (command == QLatin1Literal("list aspects")) { + if (command == QLatin1String("list aspects")) { if (d->m_aspects.isEmpty()) - return QLatin1Literal("No loaded aspect"); + return QLatin1String("No loaded aspect"); QString reply; reply += QLatin1String("Loaded aspects:"); diff --git a/src/extras/defaults/qt3dwindow.cpp b/src/extras/defaults/qt3dwindow.cpp index 2df4716dd..a2b9ba4bb 100644 --- a/src/extras/defaults/qt3dwindow.cpp +++ b/src/extras/defaults/qt3dwindow.cpp @@ -249,7 +249,7 @@ bool Qt3DWindow::event(QEvent *e) Q_D(Qt3DWindow); const bool needsRedraw = (e->type() == QEvent::Expose || e->type() == QEvent::UpdateRequest); if (needsRedraw && d->m_renderSettings->renderPolicy() == Qt3DRender::QRenderSettings::OnDemand) - d->m_renderSettings->sendCommand(QLatin1Literal("InvalidateFrame")); + d->m_renderSettings->sendCommand(QLatin1String("InvalidateFrame")); return QWindow::event(e); } diff --git a/src/quick3d/quick3drender/items/quick3draycaster.cpp b/src/quick3d/quick3drender/items/quick3draycaster.cpp index 55c08a806..b8f086983 100644 --- a/src/quick3d/quick3drender/items/quick3draycaster.cpp +++ b/src/quick3d/quick3drender/items/quick3draycaster.cpp @@ -73,38 +73,38 @@ QJSValue Quick3DRayCasterPrivate::convertHits(const QAbstractRayCaster::Hits &hi auto jsHits = engine->newArray(hits.length()); for (int i=0; inewObject(); - v.setProperty(QLatin1Literal("type"), hits[i].type()); - v.setProperty(QLatin1Literal("entity"), engine->newQObject(hits[i].entity())); - v.setProperty(QLatin1Literal("distance"), hits[i].distance()); + v.setProperty(QLatin1String("type"), hits[i].type()); + v.setProperty(QLatin1String("entity"), engine->newQObject(hits[i].entity())); + v.setProperty(QLatin1String("distance"), hits[i].distance()); { QJSValue p = engine->newObject(); - p.setProperty(QLatin1Literal("x"), hits[i].localIntersection().x()); - p.setProperty(QLatin1Literal("y"), hits[i].localIntersection().y()); - p.setProperty(QLatin1Literal("z"), hits[i].localIntersection().z()); - v.setProperty(QLatin1Literal("localIntersection"), p); + p.setProperty(QLatin1String("x"), hits[i].localIntersection().x()); + p.setProperty(QLatin1String("y"), hits[i].localIntersection().y()); + p.setProperty(QLatin1String("z"), hits[i].localIntersection().z()); + v.setProperty(QLatin1String("localIntersection"), p); } { QJSValue p = engine->newObject(); - p.setProperty(QLatin1Literal("x"), hits[i].worldIntersection().x()); - p.setProperty(QLatin1Literal("y"), hits[i].worldIntersection().y()); - p.setProperty(QLatin1Literal("z"), hits[i].worldIntersection().z()); - v.setProperty(QLatin1Literal("worldIntersection"), p); + p.setProperty(QLatin1String("x"), hits[i].worldIntersection().x()); + p.setProperty(QLatin1String("y"), hits[i].worldIntersection().y()); + p.setProperty(QLatin1String("z"), hits[i].worldIntersection().z()); + v.setProperty(QLatin1String("worldIntersection"), p); } switch (hits[i].type()) { case Qt3DRender::QRayCasterHit::TriangleHit: - v.setProperty(QLatin1Literal("primitiveIndex"), hits[i].primitiveIndex()); - v.setProperty(QLatin1Literal("vertex1Index"), hits[i].vertex1Index()); - v.setProperty(QLatin1Literal("vertex2Index"), hits[i].vertex2Index()); - v.setProperty(QLatin1Literal("vertex3Index"), hits[i].vertex3Index()); + v.setProperty(QLatin1String("primitiveIndex"), hits[i].primitiveIndex()); + v.setProperty(QLatin1String("vertex1Index"), hits[i].vertex1Index()); + v.setProperty(QLatin1String("vertex2Index"), hits[i].vertex2Index()); + v.setProperty(QLatin1String("vertex3Index"), hits[i].vertex3Index()); break; case Qt3DRender::QRayCasterHit::LineHit: - v.setProperty(QLatin1Literal("primitiveIndex"), hits[i].primitiveIndex()); - v.setProperty(QLatin1Literal("vertex1Index"), hits[i].vertex1Index()); - v.setProperty(QLatin1Literal("vertex2Index"), hits[i].vertex2Index()); + v.setProperty(QLatin1String("primitiveIndex"), hits[i].primitiveIndex()); + v.setProperty(QLatin1String("vertex1Index"), hits[i].vertex1Index()); + v.setProperty(QLatin1String("vertex2Index"), hits[i].vertex2Index()); break; case Qt3DRender::QRayCasterHit::PointHit: - v.setProperty(QLatin1Literal("primitiveIndex"), hits[i].primitiveIndex()); + v.setProperty(QLatin1String("primitiveIndex"), hits[i].primitiveIndex()); break; default: break; } diff --git a/src/render/backend/cameralens.cpp b/src/render/backend/cameralens.cpp index 42635bad7..f4815a4a9 100644 --- a/src/render/backend/cameralens.cpp +++ b/src/render/backend/cameralens.cpp @@ -159,7 +159,7 @@ void CameraLens::notifySceneBoundingVolume(const Sphere &sphere, QNodeCommand::C sphere.radius() }; QVariant v; v.setValue(data); - sendCommand(QLatin1Literal("ViewAll"), v, m_pendingViewAllCommand); + sendCommand(QLatin1String("ViewAll"), v, m_pendingViewAllCommand); } } @@ -193,12 +193,12 @@ void CameraLens::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) case CommandRequested: { QNodeCommandPtr command = qSharedPointerCast(e); - if (command->name() == QLatin1Literal("QueryRootBoundingVolume")) { + if (command->name() == QLatin1String("QueryRootBoundingVolume")) { m_pendingViewAllCommand = command->commandId(); QVariant v = command->data(); QNodeId id = v.value(); computeSceneBoundingVolume({}, id, command->commandId()); - } else if (command->name() == QLatin1Literal("QueryEntityBoundingVolume")) { + } else if (command->name() == QLatin1String("QueryEntityBoundingVolume")) { m_pendingViewAllCommand = command->commandId(); QVariant v = command->data(); QVector ids = v.value>(); diff --git a/src/render/backend/rendersettings.cpp b/src/render/backend/rendersettings.cpp index 5734f96a6..96c90f20d 100644 --- a/src/render/backend/rendersettings.cpp +++ b/src/render/backend/rendersettings.cpp @@ -94,7 +94,7 @@ void RenderSettings::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) markDirty(AbstractRenderer::AllDirty); } else if (e->type() == CommandRequested) { QNodeCommandPtr command = qSharedPointerCast(e); - if (command->name() == QLatin1Literal("InvalidateFrame")) + if (command->name() == QLatin1String("InvalidateFrame")) markDirty(AbstractRenderer::AllDirty); } diff --git a/src/render/frontend/qcameralens.cpp b/src/render/frontend/qcameralens.cpp index 6c3598fe2..296421031 100644 --- a/src/render/frontend/qcameralens.cpp +++ b/src/render/frontend/qcameralens.cpp @@ -234,7 +234,7 @@ void QCameraLens::viewAll(Qt3DCore::QNodeId cameraId) if (d->m_projectionType == PerspectiveProjection) { QVariant v; v.setValue(cameraId); - d->m_pendingViewAllCommand = sendCommand(QLatin1Literal("QueryRootBoundingVolume"), v); + d->m_pendingViewAllCommand = sendCommand(QLatin1String("QueryRootBoundingVolume"), v); } } @@ -245,7 +245,7 @@ void QCameraLens::viewEntity(Qt3DCore::QNodeId entityId, Qt3DCore::QNodeId camer QVector ids = {entityId, cameraId}; QVariant v; v.setValue(ids); - d->m_pendingViewAllCommand = sendCommand(QLatin1Literal("QueryEntityBoundingVolume"), v); + d->m_pendingViewAllCommand = sendCommand(QLatin1String("QueryEntityBoundingVolume"), v); } } @@ -641,7 +641,7 @@ void QCameraLens::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) case Qt3DCore::CommandRequested: { Qt3DCore::QNodeCommandPtr command = qSharedPointerCast(change); - if (command->name() == QLatin1Literal("ViewAll")) + if (command->name() == QLatin1String("ViewAll")) d->processViewAllCommand(command->inReplyTo(), command->data()); } break; diff --git a/tests/auto/core/qaspectengine/tst_qaspectengine.cpp b/tests/auto/core/qaspectengine/tst_qaspectengine.cpp index 94519f5e5..eb20536e6 100644 --- a/tests/auto/core/qaspectengine/tst_qaspectengine.cpp +++ b/tests/auto/core/qaspectengine/tst_qaspectengine.cpp @@ -92,7 +92,7 @@ private: \ \ QVariant executeCommand(const QStringList &args) override \ { \ - if (args.size() >= 2 && args.first() == QLatin1Literal("echo")) { \ + if (args.size() >= 2 && args.first() == QLatin1String("echo")) { \ QStringList list = args; \ list.removeFirst(); \ return QString("%1 said '%2'").arg(metaObject()->className()).arg(list.join(QLatin1Char(' '))); \ -- cgit v1.2.3