summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-06-11 19:38:28 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-06-11 19:39:01 +0200
commitdf779e0e743020d53c4bf629d781851714e26552 (patch)
treea18d97306366d767b4984831c1a20b1674510d97
parent0d740567cac4b3be17f1f3facaddc2974dfba3e7 (diff)
Replace QLatin1Literal with QLatin1String
QLatin1Literal is an undocumented and deprecated typedef for QLatin1String, just use the original. Change-Id: Id6a813ed5c0a457f003dbd118b64f77d9d82cb13 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r--src/core/aspects/qaspectengine.cpp4
-rw-r--r--src/extras/defaults/qt3dwindow.cpp2
-rw-r--r--src/quick3d/quick3drender/items/quick3draycaster.cpp38
-rw-r--r--src/render/backend/cameralens.cpp6
-rw-r--r--src/render/backend/rendersettings.cpp2
-rw-r--r--src/render/frontend/qcameralens.cpp6
-rw-r--r--tests/auto/core/qaspectengine/tst_qaspectengine.cpp2
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; i<hits.size(); i++) {
QJSValue v = engine->newObject();
- 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<QNodeCommand>(e);
- if (command->name() == QLatin1Literal("QueryRootBoundingVolume")) {
+ if (command->name() == QLatin1String("QueryRootBoundingVolume")) {
m_pendingViewAllCommand = command->commandId();
QVariant v = command->data();
QNodeId id = v.value<QNodeId>();
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<QNodeId> ids = v.value<QVector<QNodeId>>();
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<QNodeCommand>(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<Qt3DCore::QNodeId> 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<Qt3DCore::QNodeCommand>(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(' '))); \