mirror of https://github.com/qt/qt3d.git
Fix some deprecation warnings
jobs/qaspectjobmanager.cpp:90:72: warning: 'T* QWeakPointer<T>::data() const [with T = Qt3DCore::QAspectJob]' is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Wdeprecated-declarations] defaults/qtexturematerial.cpp:66:431: warning: 'QVariant qVariantFromValue(const T&) [with T = QGenericMatrix<3, 3, float>]' is deprecated: Use QVariant::fromValue() instead. [-Wdeprecated-declarations] ... testpostmanarbiter.cpp:75:51: warning: 'static QVector<T> QVector<T>::fromStdVector(const std::vector<T>&) [with T = QSharedPointer<Qt3DCore::QSceneChange>]' is deprecated: Use QVector<T>(vector.begin(), vector.end()) instead. [-Wdeprecated-declarations] tst_qray3d.cpp:510:100: warning: 'QVariant qVariantFromValue(const T&) [with T = Qt3DRender::RayCasting::QRay3D]' is deprecated: Use QVariant::fromValue() instead. [-Wdeprecated-declarations] tst_renderviewbuilder.cpp:331:120: warning: 'T* QWeakPointer<T>::data() const [with T = Qt3DCore::QAspectJob]' is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Wdeprecated-declarations] ... Change-Id: I446f3ddeb7aa2c5698d2a976fa163b443e01cc0c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
This commit is contained in:
parent
f39178a415
commit
0e25e5402e
|
|
@ -87,7 +87,7 @@ void QAspectJobManager::enqueueJobs(const QVector<QAspectJobPtr> &jobQueue)
|
|||
|
||||
int dependerCount = 0;
|
||||
for (const QWeakPointer<QAspectJob> &dep : deps) {
|
||||
AspectTaskRunnable *taskDependee = tasksMap.value(dep.data());
|
||||
AspectTaskRunnable *taskDependee = tasksMap.value(dep.toStrongRef().data());
|
||||
// The dependencies here are not hard requirements, i.e., the dependencies
|
||||
// not in the jobQueue should already have their data ready.
|
||||
if (taskDependee) {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ QTextureMaterialPrivate::QTextureMaterialPrivate()
|
|||
: QMaterialPrivate()
|
||||
, m_textureEffect(new QEffect)
|
||||
, m_textureParameter(new QParameter(QStringLiteral("diffuseTexture"), new QTexture2D))
|
||||
, m_textureTransformParameter(new QParameter(QStringLiteral("texCoordTransform"), qVariantFromValue(QMatrix3x3())))
|
||||
, m_textureTransformParameter(new QParameter(QStringLiteral("texCoordTransform"), QVariant::fromValue(QMatrix3x3())))
|
||||
, m_textureGL3Technique(new QTechnique)
|
||||
, m_textureGL2Technique(new QTechnique)
|
||||
, m_textureES2Technique(new QTechnique)
|
||||
|
|
@ -247,13 +247,13 @@ void QTextureMaterial::setTextureOffset(QVector2D textureOffset)
|
|||
QMatrix3x3 matrix = d->m_textureTransformParameter->value().value<QMatrix3x3>();
|
||||
matrix(0, 2) = textureOffset.x();
|
||||
matrix(1, 2) = textureOffset.y();
|
||||
d->m_textureTransformParameter->setValue(qVariantFromValue(matrix));
|
||||
d->m_textureTransformParameter->setValue(QVariant::fromValue(matrix));
|
||||
}
|
||||
|
||||
void QTextureMaterial::setTextureTransform(const QMatrix3x3 &matrix)
|
||||
{
|
||||
Q_D(QTextureMaterial);
|
||||
d->m_textureTransformParameter->setValue(qVariantFromValue(matrix));
|
||||
d->m_textureTransformParameter->setValue(QVariant::fromValue(matrix));
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@
|
|||
#include "testpostmanarbiter_p.h"
|
||||
#include <Qt3DCore/private/qnode_p.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
TestPostman::TestPostman(TestArbiter *arbiter)
|
||||
|
|
@ -72,7 +75,7 @@ void TestArbiter::sceneChangeEventWithLock(const Qt3DCore::QSceneChangePtr &e)
|
|||
|
||||
void TestArbiter::sceneChangeEventWithLock(const Qt3DCore::QSceneChangeList &e)
|
||||
{
|
||||
events += QVector<Qt3DCore::QSceneChangePtr>::fromStdVector(e);
|
||||
std::copy(e.cbegin(), e.cend(), std::back_inserter(events));
|
||||
}
|
||||
|
||||
Qt3DCore::QAbstractPostman *TestArbiter::postman() const
|
||||
|
|
|
|||
|
|
@ -506,7 +506,7 @@ void tst_QRay3D::properties()
|
|||
QCOMPARE(r.direction(), Vector3D(4, 5, 6));
|
||||
|
||||
obj.setProperty("ray",
|
||||
qVariantFromValue
|
||||
QVariant::fromValue
|
||||
(Qt3DRender::RayCasting::QRay3D(Vector3D(-1, -2, -3), Vector3D(-4, -5, -6))));
|
||||
|
||||
r = qvariant_cast<Qt3DRender::RayCasting::QRay3D>(obj.property("ray"));
|
||||
|
|
|
|||
|
|
@ -328,7 +328,8 @@ private Q_SLOTS:
|
|||
|
||||
// Step 2
|
||||
QCOMPARE(renderViewBuilder.syncRenderViewInitializationJob()->dependencies().size(), 1);
|
||||
QCOMPARE(renderViewBuilder.syncRenderViewInitializationJob()->dependencies().first().data(), renderViewBuilder.renderViewJob().data());
|
||||
QCOMPARE(renderViewBuilder.syncRenderViewInitializationJob()->dependencies().constFirst().toStrongRef().data(),
|
||||
renderViewBuilder.renderViewJob().data());
|
||||
|
||||
// Step 3
|
||||
QVERIFY(renderViewBuilder.filterEntityByLayerJob().isNull());
|
||||
|
|
@ -339,7 +340,8 @@ private Q_SLOTS:
|
|||
QVERIFY(renderViewBuilder.filterProximityJob()->dependencies().contains(testAspect.renderer()->expandBoundingVolumeJob()));
|
||||
|
||||
QCOMPARE(renderViewBuilder.setClearDrawBufferIndexJob()->dependencies().size(), 1);
|
||||
QCOMPARE(renderViewBuilder.setClearDrawBufferIndexJob()->dependencies().first().data(), renderViewBuilder.syncRenderViewInitializationJob().data());
|
||||
QCOMPARE(renderViewBuilder.setClearDrawBufferIndexJob()->dependencies().constFirst().toStrongRef().data(),
|
||||
renderViewBuilder.syncRenderViewInitializationJob().data());
|
||||
|
||||
QCOMPARE(renderViewBuilder.syncFrustumCullingJob()->dependencies().size(), 3);
|
||||
QVERIFY(renderViewBuilder.syncFrustumCullingJob()->dependencies().contains(renderViewBuilder.syncRenderViewInitializationJob()));
|
||||
|
|
@ -363,7 +365,8 @@ private Q_SLOTS:
|
|||
// Step 5
|
||||
for (const auto &renderViewBuilderJob : renderViewBuilder.renderViewBuilderJobs()) {
|
||||
QCOMPARE(renderViewBuilderJob->dependencies().size(), 1);
|
||||
QCOMPARE(renderViewBuilderJob->dependencies().first().data(), renderViewBuilder.syncRenderCommandBuildingJob().data());
|
||||
QCOMPARE(renderViewBuilderJob->dependencies().constFirst().toStrongRef().data(),
|
||||
renderViewBuilder.syncRenderCommandBuildingJob().data());
|
||||
}
|
||||
|
||||
// Step 6
|
||||
|
|
@ -386,7 +389,8 @@ private Q_SLOTS:
|
|||
|
||||
// Step 2
|
||||
QCOMPARE(renderViewBuilder.syncRenderViewInitializationJob()->dependencies().size(), 1);
|
||||
QCOMPARE(renderViewBuilder.syncRenderViewInitializationJob()->dependencies().first().data(), renderViewBuilder.renderViewJob().data());
|
||||
QCOMPARE(renderViewBuilder.syncRenderViewInitializationJob()->dependencies().constFirst().toStrongRef().data(),
|
||||
renderViewBuilder.renderViewJob().data());
|
||||
|
||||
// Step 3
|
||||
QCOMPARE(renderViewBuilder.filterEntityByLayerJob()->dependencies().size(), 3);
|
||||
|
|
@ -402,7 +406,8 @@ private Q_SLOTS:
|
|||
QVERIFY(renderViewBuilder.filterProximityJob()->dependencies().contains(testAspect.renderer()->expandBoundingVolumeJob()));
|
||||
|
||||
QCOMPARE(renderViewBuilder.setClearDrawBufferIndexJob()->dependencies().size(), 1);
|
||||
QCOMPARE(renderViewBuilder.setClearDrawBufferIndexJob()->dependencies().first().data(), renderViewBuilder.syncRenderViewInitializationJob().data());
|
||||
QCOMPARE(renderViewBuilder.setClearDrawBufferIndexJob()->dependencies().constFirst().toStrongRef().data(),
|
||||
renderViewBuilder.syncRenderViewInitializationJob().data());
|
||||
|
||||
QCOMPARE(renderViewBuilder.syncFrustumCullingJob()->dependencies().size(), 3);
|
||||
QVERIFY(renderViewBuilder.syncFrustumCullingJob()->dependencies().contains(renderViewBuilder.syncRenderViewInitializationJob()));
|
||||
|
|
@ -432,7 +437,8 @@ private Q_SLOTS:
|
|||
// Step 5
|
||||
for (const auto &renderViewBuilderJob : renderViewBuilder.renderViewBuilderJobs()) {
|
||||
QCOMPARE(renderViewBuilderJob->dependencies().size(), 1);
|
||||
QCOMPARE(renderViewBuilderJob->dependencies().first().data(), renderViewBuilder.syncRenderCommandBuildingJob().data());
|
||||
QCOMPARE(renderViewBuilderJob->dependencies().constFirst().toStrongRef().data(),
|
||||
renderViewBuilder.syncRenderCommandBuildingJob().data());
|
||||
}
|
||||
|
||||
// Step 6
|
||||
|
|
|
|||
Loading…
Reference in New Issue