summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/transforms/qskeletonloader.cpp12
-rw-r--r--tests/auto/core/qskeletonloader/tst_qskeletonloader.cpp65
-rw-r--r--tests/auto/render/skeleton/tst_skeleton.cpp64
3 files changed, 0 insertions, 141 deletions
diff --git a/src/core/transforms/qskeletonloader.cpp b/src/core/transforms/qskeletonloader.cpp
index d5296ecc9..b8cd6e29b 100644
--- a/src/core/transforms/qskeletonloader.cpp
+++ b/src/core/transforms/qskeletonloader.cpp
@@ -238,18 +238,6 @@ void QSkeletonLoader::setRootJoint(QJoint *rootJoint)
/*! \internal */
void QSkeletonLoader::sceneChangeEvent(const QSceneChangePtr &change)
{
- Q_D(QSkeletonLoader);
- if (change->type() == Qt3DCore::PropertyUpdated) {
- auto propertyChange = qSharedPointerCast<QStaticPropertyUpdatedChangeBase>(change);
- if (propertyChange->propertyName() == QByteArrayLiteral("status")) {
- const auto e = qSharedPointerCast<Qt3DCore::QPropertyUpdatedChange>(change);
- d->setStatus(static_cast<QSkeletonLoader::Status>(e->value().toInt()));
- } else if (propertyChange->propertyName() == QByteArrayLiteral("rootJoint")) {
- auto typedChange = qSharedPointerCast<QJointChange>(propertyChange);
- auto rootJoint = std::move(typedChange->data);
- setRootJoint(rootJoint.release());
- }
- }
QAbstractSkeleton::sceneChangeEvent(change);
}
diff --git a/tests/auto/core/qskeletonloader/tst_qskeletonloader.cpp b/tests/auto/core/qskeletonloader/tst_qskeletonloader.cpp
index 7fcdc4bbe..f0f4c3872 100644
--- a/tests/auto/core/qskeletonloader/tst_qskeletonloader.cpp
+++ b/tests/auto/core/qskeletonloader/tst_qskeletonloader.cpp
@@ -209,71 +209,6 @@ private Q_SLOTS:
QCOMPARE(arbiter.events.size(), 0);
}
}
-
- void checkStatusPropertyUpdate()
- {
- // GIVEN
- qRegisterMetaType<Qt3DCore::QSkeletonLoader::Status>("Status");
- TestArbiter arbiter;
- arbiter.setArbiterOnNode(this);
- QSignalSpy spy(this, SIGNAL(statusChanged(Status)));
- const QSkeletonLoader::Status newStatus = QSkeletonLoader::Error;
-
- // THEN
- QVERIFY(spy.isValid());
-
- // WHEN
- QPropertyUpdatedChangePtr valueChange(new QPropertyUpdatedChange(QNodeId()));
- valueChange->setPropertyName("status");
- valueChange->setValue(QVariant::fromValue(newStatus));
- sceneChangeEvent(valueChange);
-
- // THEN
- QCOMPARE(spy.count(), 1);
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(status(), newStatus);
-
- // WHEN
- spy.clear();
- sceneChangeEvent(valueChange);
-
- // THEN
- QCOMPARE(spy.count(), 0);
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(status(), newStatus);
-
- // Cleanup
- QNodePrivate::get(this)->setArbiter(nullptr);
- }
-
- void checkRootJointPropertyUpdate()
- {
- // GIVEN
- qRegisterMetaType<Qt3DCore::QJoint*>();
- TestArbiter arbiter;
- arbiter.setArbiterOnNode(this);
- QSignalSpy spy(this, SIGNAL(rootJointChanged(Qt3DCore::QJoint*)));
- std::unique_ptr<QJoint> root(new QJoint());
-
- // THEN
- QVERIFY(spy.isValid());
- QVERIFY(rootJoint() == nullptr);
-
- // WHEN
- auto valueChange = QJointChangePtr::create(id());
- valueChange->setDeliveryFlags(Qt3DCore::QSceneChange::Nodes);
- valueChange->setPropertyName("rootJoint");
- valueChange->data = std::move(root);
- sceneChangeEvent(valueChange);
-
- // THEN
- QCOMPARE(spy.count(), 1);
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QVERIFY(rootJoint() != nullptr);
-
- // Cleanup
- QNodePrivate::get(this)->setArbiter(nullptr);
- }
};
QTEST_MAIN(tst_QSkeletonLoader)
diff --git a/tests/auto/render/skeleton/tst_skeleton.cpp b/tests/auto/render/skeleton/tst_skeleton.cpp
index 2786f27a8..63ed51058 100644
--- a/tests/auto/render/skeleton/tst_skeleton.cpp
+++ b/tests/auto/render/skeleton/tst_skeleton.cpp
@@ -198,70 +198,6 @@ private Q_SLOTS:
joint->setName(name);
QTest::newRow("inverseBind") << m << localPose << name << joint;
}
-
- void checkCreateFrontendJoints_data()
- {
- QTest::addColumn<SkeletonData>("skeletonData");
- QTest::addColumn<QJoint *>("expectedRootJoint");
-
- QTest::newRow("empty") << SkeletonData() << static_cast<QJoint*>(nullptr);
-
- SkeletonData skeletonData;
- JointInfo rootJointInfo;
- skeletonData.joints.push_back(rootJointInfo);
- skeletonData.jointNames.push_back(QLatin1String("rootJoint"));
- skeletonData.localPoses.push_back(Qt3DCore::Sqt());
- const int childCount = 10;
- for (int i = 0; i < childCount; ++i) {
- JointInfo childJointInfo;
- childJointInfo.parentIndex = 0;
- skeletonData.joints.push_back(childJointInfo);
-
- const float x = static_cast<float>(i);
- Qt3DCore::Sqt localPose;
- localPose.translation = QVector3D(x, x, x);
- skeletonData.localPoses.push_back(localPose);
-
- skeletonData.jointNames.push_back(QString("Child-%1").arg(i));
- }
-
- QJoint *rootJoint = new QJoint();
- for (int i = 0; i < childCount; ++i) {
- QJoint *childJoint = new QJoint();
- const float x = static_cast<float>(i);
- childJoint->setTranslation(QVector3D(x, x, x));
- rootJoint->addChildJoint(childJoint);
- }
-
- QTest::newRow("wide") << skeletonData << rootJoint;
-
- skeletonData.joints.clear();
- skeletonData.joints.push_back(rootJointInfo);
- for (int i = 0; i < childCount; ++i) {
- JointInfo childJointInfo;
- childJointInfo.parentIndex = i;
- skeletonData.joints.push_back(childJointInfo);
-
- const float x = static_cast<float>(i);
- Qt3DCore::Sqt localPose;
- localPose.translation = QVector3D(x, x, x);
- skeletonData.localPoses.push_back(localPose);
-
- skeletonData.jointNames.push_back(QString("Child-%1").arg(i));
- }
-
- rootJoint = new QJoint();
- QJoint *previousJoint = rootJoint;
- for (int i = 0; i < childCount; ++i) {
- QJoint *childJoint = new QJoint();
- const float x = static_cast<float>(i);
- childJoint->setTranslation(QVector3D(x, x, x));
- previousJoint->addChildJoint(childJoint);
- previousJoint = childJoint;
- }
-
- QTest::newRow("deep") << skeletonData << rootJoint;
- }
};
QTEST_APPLESS_MAIN(tst_Skeleton)