summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-06-19 08:20:50 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-06-19 08:20:51 +0200
commite35b41fa9f713dcbfb7299b9effeadf52cfb6353 (patch)
tree548a7b2243ed5bd70e4599dfcf0198f0fedddf05
parent9c28631440e37444ade0a1e1634d8f4d46bcd4d7 (diff)
parent01a6bcd086cecef3169e5d79bd72dbb0d1393a0f (diff)
Merge 5.9 into 5.9.1
-rw-r--r--src/animation/backend/animationutils.cpp24
-rw-r--r--src/animation/backend/fcurve.cpp52
-rw-r--r--src/animation/frontend/qabstractclipanimator.cpp2
-rw-r--r--src/animation/frontend/qchannelmapping.cpp9
-rw-r--r--src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp15
-rw-r--r--src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h3
-rw-r--r--src/render/frontend/qcamera_p.h3
-rw-r--r--src/render/frontend/qcameralens_p.h3
-rw-r--r--src/render/frontend/qcomputecommand_p.h3
-rw-r--r--src/render/frontend/qlayer_p.h3
-rw-r--r--src/render/frontend/qlevelofdetail_p.h3
-rw-r--r--src/render/frontend/qpickingsettings_p.h3
-rw-r--r--src/render/frontend/qrendersettings_p.h3
-rw-r--r--src/render/frontend/qrendertarget_p.h3
-rw-r--r--src/render/frontend/qrendertargetoutput_p.h3
-rw-r--r--src/render/geometry/qgeometryrenderer_p.h3
-rw-r--r--src/render/geometry/qmesh_p.h3
-rw-r--r--src/render/lights/qabstractlight_p.h3
-rw-r--r--src/render/lights/qdirectionallight_p.h3
-rw-r--r--src/render/lights/qenvironmentlight_p.h3
-rw-r--r--src/render/lights/qpointlight_p.h3
-rw-r--r--src/render/lights/qspotlight_p.h3
-rw-r--r--src/render/materialsystem/qeffect_p.h3
-rw-r--r--src/render/materialsystem/qfilterkey_p.h3
-rw-r--r--src/render/materialsystem/qgraphicsapifilter_p.h3
-rw-r--r--src/render/picking/qobjectpicker_p.h3
-rw-r--r--src/render/renderstates/qblendequation_p.h3
-rw-r--r--src/render/renderstates/qblendequationarguments_p.h3
-rw-r--r--src/render/renderstates/qclipplane_p.h3
-rw-r--r--src/render/renderstates/qcolormask_p.h3
-rw-r--r--src/render/renderstates/qcullface_p.h3
-rw-r--r--src/render/renderstates/qdepthtest_p.h3
-rw-r--r--src/render/renderstates/qfrontface_p.h3
-rw-r--r--src/render/renderstates/qpointsize_p.h3
-rw-r--r--src/render/renderstates/qpolygonoffset_p.h3
-rw-r--r--src/render/renderstates/qscissortest_p.h3
-rw-r--r--src/render/renderstates/qstencilmask_p.h3
-rw-r--r--src/render/renderstates/qstenciloperation_p.h3
-rw-r--r--src/render/renderstates/qstenciloperationarguments_p.h3
-rw-r--r--src/render/renderstates/qstenciltest_p.h3
-rw-r--r--src/render/renderstates/qstenciltestarguments_p.h3
-rw-r--r--src/render/texture/qpaintedtextureimage_p.h3
-rw-r--r--src/render/texture/qtexture_p.h3
-rw-r--r--src/render/texture/qtextureimage_p.h3
-rw-r--r--tests/auto/animation/animationutils/animationutils.qrc1
-rw-r--r--tests/auto/animation/animationutils/clip4.json65
-rw-r--r--tests/auto/animation/animationutils/tst_animationutils.cpp57
-rw-r--r--tests/auto/quick3d/quick3dnodeinstantiator/data/createNested.qml15
-rw-r--r--tests/auto/quick3d/quick3dnodeinstantiator/quick3dnodeinstantiator.pro1
-rw-r--r--tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp29
50 files changed, 329 insertions, 58 deletions
diff --git a/src/animation/backend/animationutils.cpp b/src/animation/backend/animationutils.cpp
index ef6aec058..c12ad99f7 100644
--- a/src/animation/backend/animationutils.cpp
+++ b/src/animation/backend/animationutils.cpp
@@ -46,6 +46,7 @@
#include <QtGui/qvector3d.h>
#include <QtGui/qvector4d.h>
#include <QtGui/qquaternion.h>
+#include <QtGui/qcolor.h>
#include <QtCore/qvariant.h>
#include <Qt3DAnimation/private/animationlogging_p.h>
@@ -60,6 +61,7 @@ int componentsForType(int type)
{
int componentCount = 1;
switch (type) {
+ case QMetaType::Float:
case QVariant::Double:
componentCount = 1;
break;
@@ -69,6 +71,7 @@ int componentsForType(int type)
break;
case QVariant::Vector3D:
+ case QVariant::Color:
componentCount = 3;
break;
@@ -149,15 +152,21 @@ ComponentIndices channelComponentsToIndices(const Channel &channel, int dataType
#if defined Q_COMPILER_UNIFORM_INIT
static const QVector<char> standardSuffixes = { 'X', 'Y', 'Z', 'W' };
static const QVector<char> quaternionSuffixes = { 'W', 'X', 'Y', 'Z' };
+ static const QVector<char> colorSuffixes = { 'R', 'G', 'B' };
#else
static const QVector<char> standardSuffixes = (QVector<char>() << 'X' << 'Y' << 'Z' << 'W');
static const QVector<char> quaternionSuffixes = (QVector<char>() << 'W' << 'X' << 'Y' << 'Z');
+ static const QVector<char> colorSuffixes = (QVector<char>() << 'R' << 'G' << 'B');
#endif
- if (dataType != QVariant::Quaternion)
- return channelComponentsToIndicesHelper(channel, dataType, offset, standardSuffixes);
- else
+ switch (dataType) {
+ case QVariant::Quaternion:
return channelComponentsToIndicesHelper(channel, dataType, offset, quaternionSuffixes);
+ case QVariant::Color:
+ return channelComponentsToIndicesHelper(channel, dataType, offset, colorSuffixes);
+ default:
+ return channelComponentsToIndicesHelper(channel, dataType, offset, standardSuffixes);
+ }
}
ComponentIndices channelComponentsToIndicesHelper(const Channel &channel,
@@ -229,6 +238,7 @@ QVector<Qt3DCore::QSceneChangePtr> preparePropertyChanges(Qt3DCore::QNodeId anim
// Build the new value from the channel/fcurve evaluation results
QVariant v;
switch (mappingData.type) {
+ case QMetaType::Float:
case QVariant::Double: {
v = QVariant::fromValue(channelResults[mappingData.channelIndices[0]]);
break;
@@ -268,6 +278,14 @@ QVector<Qt3DCore::QSceneChangePtr> preparePropertyChanges(Qt3DCore::QNodeId anim
break;
}
+ case QVariant::Color: {
+ const QColor color = QColor::fromRgbF(channelResults[mappingData.channelIndices[0]],
+ channelResults[mappingData.channelIndices[1]],
+ channelResults[mappingData.channelIndices[2]]);
+ v = QVariant::fromValue(color);
+ break;
+ }
+
default:
qWarning() << "Unhandled animation type";
continue;
diff --git a/src/animation/backend/fcurve.cpp b/src/animation/backend/fcurve.cpp
index 809949472..4a2cf30fd 100644
--- a/src/animation/backend/fcurve.cpp
+++ b/src/animation/backend/fcurve.cpp
@@ -60,12 +60,35 @@ float FCurve::evaluateAtTime(float localTime) const
return m_keyframes.last().value;
} else {
// Find keyframes that sandwich the requested localTime
- int keyframe0 = m_rangeFinder.findLowerBound(localTime);
-
- BezierEvaluator evaluator(m_localTimes[keyframe0], m_keyframes[keyframe0],
- m_localTimes[keyframe0 + 1], m_keyframes[keyframe0 + 1]);
- return evaluator.valueForTime(localTime);
+ const int idx = m_rangeFinder.findLowerBound(localTime);
+
+ const float t0 = m_localTimes[idx];
+ const float t1 = m_localTimes[idx + 1];
+ const Keyframe &keyframe0(m_keyframes[idx]);
+ const Keyframe &keyframe1(m_keyframes[idx + 1]);
+
+ switch (keyframe0.interpolation) {
+ case QKeyFrame::ConstantInterpolation:
+ qWarning("Constant interpolation not implemented yet");
+ break;
+ case QKeyFrame::LinearInterpolation:
+ if (localTime >= t0 && localTime <= t1 && t1 > t0) {
+ float t = (localTime - t0) / (t1 - t0);
+ return (1 - t) * keyframe0.value + t * keyframe1.value;
+ }
+ break;
+ case QKeyFrame::BezierInterpolation:
+ {
+ BezierEvaluator evaluator(t0, keyframe0, t1, keyframe1);
+ return evaluator.valueForTime(localTime);
+ }
+ default:
+ qWarning("Unknown interpolation type %d", keyframe0.interpolation);
+ break;
+ }
}
+
+ return m_keyframes.first().value;
}
float FCurve::startTime() const
@@ -103,16 +126,21 @@ void FCurve::read(const QJsonObject &json)
float localTime = keyframeCoords.at(0).toDouble();
Keyframe keyframe;
- keyframe.interpolation = QKeyFrame::BezierInterpolation;
keyframe.value = keyframeCoords.at(1).toDouble();
- const QJsonArray leftHandle = keyframeData[QLatin1String("leftHandle")].toArray();
- keyframe.leftControlPoint[0] = leftHandle.at(0).toDouble();
- keyframe.leftControlPoint[1] = leftHandle.at(1).toDouble();
+ if (keyframeData.contains(QLatin1String("leftHandle"))) {
+ keyframe.interpolation = QKeyFrame::BezierInterpolation;
+
+ const QJsonArray leftHandle = keyframeData[QLatin1String("leftHandle")].toArray();
+ keyframe.leftControlPoint[0] = leftHandle.at(0).toDouble();
+ keyframe.leftControlPoint[1] = leftHandle.at(1).toDouble();
- const QJsonArray rightHandle = keyframeData[QLatin1String("rightHandle")].toArray();
- keyframe.rightControlPoint[0] = rightHandle.at(0).toDouble();
- keyframe.rightControlPoint[1] = rightHandle.at(1).toDouble();
+ const QJsonArray rightHandle = keyframeData[QLatin1String("rightHandle")].toArray();
+ keyframe.rightControlPoint[0] = rightHandle.at(0).toDouble();
+ keyframe.rightControlPoint[1] = rightHandle.at(1).toDouble();
+ } else {
+ keyframe.interpolation = QKeyFrame::LinearInterpolation;
+ }
appendKeyframe(localTime, keyframe);
}
diff --git a/src/animation/frontend/qabstractclipanimator.cpp b/src/animation/frontend/qabstractclipanimator.cpp
index 0d215b470..c75b92d47 100644
--- a/src/animation/frontend/qabstractclipanimator.cpp
+++ b/src/animation/frontend/qabstractclipanimator.cpp
@@ -54,7 +54,7 @@ QAbstractClipAnimatorPrivate::QAbstractClipAnimatorPrivate()
}
/*!
- \qmltype AbsractClipAnimator
+ \qmltype AbstractClipAnimator
\instantiates Qt3DAnimation::QAbstractClipAnimator
\inqmlmodule Qt3D.Animation
\since 5.9
diff --git a/src/animation/frontend/qchannelmapping.cpp b/src/animation/frontend/qchannelmapping.cpp
index b3d3816a0..faa77f5db 100644
--- a/src/animation/frontend/qchannelmapping.cpp
+++ b/src/animation/frontend/qchannelmapping.cpp
@@ -74,6 +74,15 @@ void QChannelMappingPrivate::updatePropertyNameAndType()
QMetaProperty mp = mo->property(propertyIndex);
propertyName = mp.name();
type = mp.userType();
+ if (type == QMetaType::QVariant) {
+ QVariant currentValue = m_target->property(mp.name());
+ if (currentValue.isValid()) {
+ type = currentValue.userType();
+ } else {
+ qWarning("QChannelMapping: Attempted to target QVariant property with no value set. "
+ "Set a value first in order to be able to determine the type.");
+ }
+ }
}
if (m_type != type) {
diff --git a/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp b/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp
index 1626554ea..b99f6ae75 100644
--- a/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp
+++ b/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp
@@ -98,7 +98,8 @@ Quick3DNodeInstantiatorPrivate::Quick3DNodeInstantiatorPrivate()
Quick3DNodeInstantiatorPrivate::~Quick3DNodeInstantiatorPrivate()
{
- qDeleteAll(m_objects);
+ if (m_ownModel)
+ delete m_instanceModel;
}
void Quick3DNodeInstantiatorPrivate::clear()
@@ -244,6 +245,7 @@ void Quick3DNodeInstantiatorPrivate::makeModel()
Quick3DNodeInstantiator::Quick3DNodeInstantiator(QNode *parent)
: QNode(*new Quick3DNodeInstantiatorPrivate, parent)
{
+ connect(this, &QNode::parentChanged, this, &Quick3DNodeInstantiator::onParentChanged);
}
/*!
@@ -500,6 +502,17 @@ void Quick3DNodeInstantiator::componentComplete()
}
}
+/*!
+ \internal
+*/
+void Quick3DNodeInstantiator::onParentChanged(QObject *parent)
+{
+ Q_D(const Quick3DNodeInstantiator);
+ auto parentNode = static_cast<QNode *>(parent);
+ for (auto obj : d->m_objects)
+ static_cast<QNode *>(obj.data())->setParent(parentNode);
+}
+
// TODO: Avoid cloning here
//void Quick3DNodeInstantiator::copy(const QNode *ref)
//{
diff --git a/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h b/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h
index fd7a1d83d..a79cb4f90 100644
--- a/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h
+++ b/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h
@@ -113,6 +113,9 @@ Q_SIGNALS:
void objectAdded(int index, QObject *object);
void objectRemoved(int index, QObject *object);
+private slots:
+ void onParentChanged(QObject *parent);
+
private:
Q_DISABLE_COPY(Quick3DNodeInstantiator)
Q_DECLARE_PRIVATE(Quick3DNodeInstantiator)
diff --git a/src/render/frontend/qcamera_p.h b/src/render/frontend/qcamera_p.h
index 107b1d268..a310fc765 100644
--- a/src/render/frontend/qcamera_p.h
+++ b/src/render/frontend/qcamera_p.h
@@ -54,12 +54,13 @@
#include <Qt3DRender/qcameralens.h>
#include <Qt3DCore/qtransform.h>
#include <private/qentity_p.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QCameraPrivate : public Qt3DCore::QEntityPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QCameraPrivate : public Qt3DCore::QEntityPrivate
{
public:
QCameraPrivate();
diff --git a/src/render/frontend/qcameralens_p.h b/src/render/frontend/qcameralens_p.h
index 71759d5f8..e79645b3c 100644
--- a/src/render/frontend/qcameralens_p.h
+++ b/src/render/frontend/qcameralens_p.h
@@ -52,6 +52,7 @@
//
#include <Qt3DCore/private/qcomponent_p.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
#include "qcameralens.h"
#include <Qt3DCore/qpropertyupdatedchange.h>
@@ -62,7 +63,7 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QCameraLensPrivate : public Qt3DCore::QComponentPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QCameraLensPrivate : public Qt3DCore::QComponentPrivate
{
public:
QCameraLensPrivate();
diff --git a/src/render/frontend/qcomputecommand_p.h b/src/render/frontend/qcomputecommand_p.h
index 3b595ef99..874edb1fc 100644
--- a/src/render/frontend/qcomputecommand_p.h
+++ b/src/render/frontend/qcomputecommand_p.h
@@ -52,12 +52,13 @@
//
#include <Qt3DCore/private/qcomponent_p.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QComputeCommandPrivate : public Qt3DCore::QComponentPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QComputeCommandPrivate : public Qt3DCore::QComponentPrivate
{
public:
QComputeCommandPrivate();
diff --git a/src/render/frontend/qlayer_p.h b/src/render/frontend/qlayer_p.h
index e31d8fe7a..998dcce86 100644
--- a/src/render/frontend/qlayer_p.h
+++ b/src/render/frontend/qlayer_p.h
@@ -52,13 +52,14 @@
//
#include <private/qcomponent_p.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QLayerPrivate : public Qt3DCore::QComponentPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QLayerPrivate : public Qt3DCore::QComponentPrivate
{
public:
QLayerPrivate();
diff --git a/src/render/frontend/qlevelofdetail_p.h b/src/render/frontend/qlevelofdetail_p.h
index 1d7a05a71..136d2ffa3 100644
--- a/src/render/frontend/qlevelofdetail_p.h
+++ b/src/render/frontend/qlevelofdetail_p.h
@@ -54,6 +54,7 @@
#include <private/qcomponent_p.h>
#include <qlevelofdetail.h>
#include <Qt3DRender/qlevelofdetailboundingsphere.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
#include <QVector3D>
@@ -61,7 +62,7 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QLevelOfDetailPrivate : public Qt3DCore::QComponentPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QLevelOfDetailPrivate : public Qt3DCore::QComponentPrivate
{
public:
QLevelOfDetailPrivate();
diff --git a/src/render/frontend/qpickingsettings_p.h b/src/render/frontend/qpickingsettings_p.h
index 039b6a435..7928597c8 100644
--- a/src/render/frontend/qpickingsettings_p.h
+++ b/src/render/frontend/qpickingsettings_p.h
@@ -53,12 +53,13 @@
#include <Qt3DCore/private/qnode_p.h>
#include <Qt3DRender/qpickingsettings.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QPickingSettingsPrivate : public Qt3DCore::QNodePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QPickingSettingsPrivate : public Qt3DCore::QNodePrivate
{
public:
QPickingSettingsPrivate();
diff --git a/src/render/frontend/qrendersettings_p.h b/src/render/frontend/qrendersettings_p.h
index f05124296..9420a9546 100644
--- a/src/render/frontend/qrendersettings_p.h
+++ b/src/render/frontend/qrendersettings_p.h
@@ -54,12 +54,13 @@
#include <Qt3DCore/private/qcomponent_p.h>
#include <Qt3DRender/qrendersettings.h>
#include <Qt3DRender/qpickingsettings.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QRenderSettingsPrivate : public Qt3DCore::QComponentPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QRenderSettingsPrivate : public Qt3DCore::QComponentPrivate
{
public:
QRenderSettingsPrivate();
diff --git a/src/render/frontend/qrendertarget_p.h b/src/render/frontend/qrendertarget_p.h
index 44a8ac0c1..f1035e846 100644
--- a/src/render/frontend/qrendertarget_p.h
+++ b/src/render/frontend/qrendertarget_p.h
@@ -52,6 +52,7 @@
//
#include <Qt3DCore/private/qcomponent_p.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
@@ -60,7 +61,7 @@ namespace Qt3DRender {
class QRenderTargetOutput;
class QRenderTarget;
-class QRenderTargetPrivate : public Qt3DCore::QComponentPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QRenderTargetPrivate : public Qt3DCore::QComponentPrivate
{
public:
QRenderTargetPrivate();
diff --git a/src/render/frontend/qrendertargetoutput_p.h b/src/render/frontend/qrendertargetoutput_p.h
index abd352ac9..df855f184 100644
--- a/src/render/frontend/qrendertargetoutput_p.h
+++ b/src/render/frontend/qrendertargetoutput_p.h
@@ -53,6 +53,7 @@
#include <Qt3DCore/private/qnode_p.h>
#include <Qt3DRender/qrendertargetoutput.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
@@ -60,7 +61,7 @@ namespace Qt3DRender {
class QAbstractTexture;
-class QRenderTargetOutputPrivate : public Qt3DCore::QNodePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QRenderTargetOutputPrivate : public Qt3DCore::QNodePrivate
{
public:
QRenderTargetOutputPrivate();
diff --git a/src/render/geometry/qgeometryrenderer_p.h b/src/render/geometry/qgeometryrenderer_p.h
index 622cfb254..324dc9609 100644
--- a/src/render/geometry/qgeometryrenderer_p.h
+++ b/src/render/geometry/qgeometryrenderer_p.h
@@ -54,6 +54,7 @@
#include <Qt3DCore/private/qcomponent_p.h>
#include <Qt3DRender/qgeometryrenderer.h>
#include <Qt3DRender/qgeometryfactory.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
#include <Qt3DCore/private/qtypedpropertyupdatechange_p.h>
#include <memory>
@@ -61,7 +62,7 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QGeometryRendererPrivate : public Qt3DCore::QComponentPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QGeometryRendererPrivate : public Qt3DCore::QComponentPrivate
{
public:
QGeometryRendererPrivate();
diff --git a/src/render/geometry/qmesh_p.h b/src/render/geometry/qmesh_p.h
index a621525cc..23449d22a 100644
--- a/src/render/geometry/qmesh_p.h
+++ b/src/render/geometry/qmesh_p.h
@@ -52,6 +52,7 @@
//
#include <Qt3DRender/private/qgeometryrenderer_p.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
#include <QUrl>
QT_BEGIN_NAMESPACE
@@ -60,7 +61,7 @@ namespace Qt3DRender {
class QMesh;
-class QMeshPrivate : public QGeometryRendererPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QMeshPrivate : public QGeometryRendererPrivate
{
public:
QMeshPrivate();
diff --git a/src/render/lights/qabstractlight_p.h b/src/render/lights/qabstractlight_p.h
index bfab787a3..f7831dce2 100644
--- a/src/render/lights/qabstractlight_p.h
+++ b/src/render/lights/qabstractlight_p.h
@@ -52,6 +52,7 @@
//
#include <private/qcomponent_p.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
#include <qshaderdata.h>
QT_BEGIN_NAMESPACE
@@ -60,7 +61,7 @@ namespace Qt3DRender {
class QAbstractLight;
-class Q_AUTOTEST_EXPORT QAbstractLightPrivate : public Qt3DCore::QComponentPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QAbstractLightPrivate : public Qt3DCore::QComponentPrivate
{
public:
explicit QAbstractLightPrivate(QAbstractLight::Type type);
diff --git a/src/render/lights/qdirectionallight_p.h b/src/render/lights/qdirectionallight_p.h
index bc815ce30..ea80913eb 100644
--- a/src/render/lights/qdirectionallight_p.h
+++ b/src/render/lights/qdirectionallight_p.h
@@ -52,6 +52,7 @@
//
#include <private/qabstractlight_p.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
@@ -59,7 +60,7 @@ namespace Qt3DRender {
class QDirectionalLight;
-class QDirectionalLightPrivate : QAbstractLightPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QDirectionalLightPrivate : QAbstractLightPrivate
{
public:
QDirectionalLightPrivate();
diff --git a/src/render/lights/qenvironmentlight_p.h b/src/render/lights/qenvironmentlight_p.h
index e98da5f59..02358dafc 100644
--- a/src/render/lights/qenvironmentlight_p.h
+++ b/src/render/lights/qenvironmentlight_p.h
@@ -52,6 +52,7 @@
//
#include <private/qcomponent_p.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
#include <qshaderdata.h>
QT_BEGIN_NAMESPACE
@@ -61,7 +62,7 @@ namespace Qt3DRender {
class QAbstractTexture;
class QEnvironmentLight;
-class Q_AUTOTEST_EXPORT QEnvironmentLightPrivate : public Qt3DCore::QComponentPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QEnvironmentLightPrivate : public Qt3DCore::QComponentPrivate
{
public:
explicit QEnvironmentLightPrivate();
diff --git a/src/render/lights/qpointlight_p.h b/src/render/lights/qpointlight_p.h
index 978627fb7..147867667 100644
--- a/src/render/lights/qpointlight_p.h
+++ b/src/render/lights/qpointlight_p.h
@@ -52,6 +52,7 @@
//
#include <private/qabstractlight_p.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
@@ -59,7 +60,7 @@ namespace Qt3DRender {
class QPointLight;
-class QPointLightPrivate : public QAbstractLightPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QPointLightPrivate : public QAbstractLightPrivate
{
public:
QPointLightPrivate();
diff --git a/src/render/lights/qspotlight_p.h b/src/render/lights/qspotlight_p.h
index 0bb0cb80f..eabc00353 100644
--- a/src/render/lights/qspotlight_p.h
+++ b/src/render/lights/qspotlight_p.h
@@ -52,6 +52,7 @@
//
#include <private/qabstractlight_p.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
@@ -59,7 +60,7 @@ namespace Qt3DRender {
class QSpotLight;
-class QSpotLightPrivate : public QAbstractLightPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QSpotLightPrivate : public QAbstractLightPrivate
{
public:
QSpotLightPrivate();
diff --git a/src/render/materialsystem/qeffect_p.h b/src/render/materialsystem/qeffect_p.h
index 716bb76de..39c7d1ecc 100644
--- a/src/render/materialsystem/qeffect_p.h
+++ b/src/render/materialsystem/qeffect_p.h
@@ -53,6 +53,7 @@
#include <private/qnode_p.h>
#include <Qt3DRender/qt3drender_global.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
@@ -62,7 +63,7 @@ class QEffect;
class QParameter;
class QTechnique;
-class QEffectPrivate : public Qt3DCore::QNodePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QEffectPrivate : public Qt3DCore::QNodePrivate
{
public :
QEffectPrivate();
diff --git a/src/render/materialsystem/qfilterkey_p.h b/src/render/materialsystem/qfilterkey_p.h
index 3a9855f08..4050bc295 100644
--- a/src/render/materialsystem/qfilterkey_p.h
+++ b/src/render/materialsystem/qfilterkey_p.h
@@ -53,12 +53,13 @@
#include <Qt3DCore/private/qnode_p.h>
#include <Qt3DRender/qfilterkey.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QFilterKeyPrivate : public Qt3DCore::QNodePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QFilterKeyPrivate : public Qt3DCore::QNodePrivate
{
public:
QFilterKeyPrivate();
diff --git a/src/render/materialsystem/qgraphicsapifilter_p.h b/src/render/materialsystem/qgraphicsapifilter_p.h
index 723eb14c2..5a7d874ed 100644
--- a/src/render/materialsystem/qgraphicsapifilter_p.h
+++ b/src/render/materialsystem/qgraphicsapifilter_p.h
@@ -42,6 +42,7 @@
#include <private/qobject_p.h>
#include <Qt3DRender/qgraphicsapifilter.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
//
// W A R N I N G
@@ -74,7 +75,7 @@ struct Q_AUTOTEST_EXPORT GraphicsApiFilterData
bool operator <(const GraphicsApiFilterData &other) const;
};
-class Q_AUTOTEST_EXPORT QGraphicsApiFilterPrivate : public QObjectPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QGraphicsApiFilterPrivate : public QObjectPrivate
{
public:
QGraphicsApiFilterPrivate()
diff --git a/src/render/picking/qobjectpicker_p.h b/src/render/picking/qobjectpicker_p.h
index 884e5673b..3c48b9419 100644
--- a/src/render/picking/qobjectpicker_p.h
+++ b/src/render/picking/qobjectpicker_p.h
@@ -50,6 +50,7 @@
#include <Qt3DCore/private/qcomponent_p.h>
#include <Qt3DCore/qnodeid.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
@@ -58,7 +59,7 @@ namespace Qt3DRender {
/*!
\internal
*/
-class QObjectPickerPrivate : public Qt3DCore::QComponentPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QObjectPickerPrivate : public Qt3DCore::QComponentPrivate
{
public:
QObjectPickerPrivate()
diff --git a/src/render/renderstates/qblendequation_p.h b/src/render/renderstates/qblendequation_p.h
index 978944566..228e61f15 100644
--- a/src/render/renderstates/qblendequation_p.h
+++ b/src/render/renderstates/qblendequation_p.h
@@ -50,12 +50,13 @@
#include <Qt3DRender/private/qrenderstate_p.h>
#include <Qt3DRender/qblendequation.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QBlendEquationPrivate : public QRenderStatePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QBlendEquationPrivate : public QRenderStatePrivate
{
public:
QBlendEquationPrivate()
diff --git a/src/render/renderstates/qblendequationarguments_p.h b/src/render/renderstates/qblendequationarguments_p.h
index 55766b1c2..110039295 100644
--- a/src/render/renderstates/qblendequationarguments_p.h
+++ b/src/render/renderstates/qblendequationarguments_p.h
@@ -50,12 +50,13 @@
#include <Qt3DRender/private/qrenderstate_p.h>
#include <Qt3DRender/qblendequationarguments.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QBlendEquationArgumentsPrivate : public QRenderStatePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QBlendEquationArgumentsPrivate : public QRenderStatePrivate
{
public:
QBlendEquationArgumentsPrivate(Render::StateMask type = Render::BlendEquationArgumentsMask)
diff --git a/src/render/renderstates/qclipplane_p.h b/src/render/renderstates/qclipplane_p.h
index 11ce8335d..517831e10 100644
--- a/src/render/renderstates/qclipplane_p.h
+++ b/src/render/renderstates/qclipplane_p.h
@@ -50,12 +50,13 @@
#include <Qt3DRender/private/qrenderstate_p.h>
#include <Qt3DRender/qalphatest.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QClipPlanePrivate : public QRenderStatePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QClipPlanePrivate : public QRenderStatePrivate
{
public:
QClipPlanePrivate()
diff --git a/src/render/renderstates/qcolormask_p.h b/src/render/renderstates/qcolormask_p.h
index 32a350b75..1e2386eb9 100644
--- a/src/render/renderstates/qcolormask_p.h
+++ b/src/render/renderstates/qcolormask_p.h
@@ -49,12 +49,13 @@
//
#include <Qt3DRender/private/qrenderstate_p.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QColorMaskPrivate : public QRenderStatePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QColorMaskPrivate : public QRenderStatePrivate
{
public:
QColorMaskPrivate()
diff --git a/src/render/renderstates/qcullface_p.h b/src/render/renderstates/qcullface_p.h
index a258ef38f..98cf99454 100644
--- a/src/render/renderstates/qcullface_p.h
+++ b/src/render/renderstates/qcullface_p.h
@@ -50,12 +50,13 @@
#include <Qt3DRender/private/qrenderstate_p.h>
#include <Qt3DRender/qcullface.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QCullFacePrivate : public QRenderStatePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QCullFacePrivate : public QRenderStatePrivate
{
public:
QCullFacePrivate()
diff --git a/src/render/renderstates/qdepthtest_p.h b/src/render/renderstates/qdepthtest_p.h
index b3a3106fd..555be2d4a 100644
--- a/src/render/renderstates/qdepthtest_p.h
+++ b/src/render/renderstates/qdepthtest_p.h
@@ -50,12 +50,13 @@
#include <Qt3DRender/private/qrenderstate_p.h>
#include <Qt3DRender/qdepthtest.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QDepthTestPrivate : public QRenderStatePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QDepthTestPrivate : public QRenderStatePrivate
{
public :
QDepthTestPrivate()
diff --git a/src/render/renderstates/qfrontface_p.h b/src/render/renderstates/qfrontface_p.h
index c9354b0d5..3849714fd 100644
--- a/src/render/renderstates/qfrontface_p.h
+++ b/src/render/renderstates/qfrontface_p.h
@@ -50,12 +50,13 @@
#include <Qt3DRender/private/qrenderstate_p.h>
#include <Qt3DRender/qfrontface.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QFrontFacePrivate : public QRenderStatePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QFrontFacePrivate : public QRenderStatePrivate
{
public:
QFrontFacePrivate()
diff --git a/src/render/renderstates/qpointsize_p.h b/src/render/renderstates/qpointsize_p.h
index e1f216133..eb669b131 100644
--- a/src/render/renderstates/qpointsize_p.h
+++ b/src/render/renderstates/qpointsize_p.h
@@ -50,12 +50,13 @@
#include <Qt3DRender/private/qrenderstate_p.h>
#include <Qt3DRender/qpointsize.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QPointSizePrivate : public QRenderStatePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QPointSizePrivate : public QRenderStatePrivate
{
public:
QPointSizePrivate(QPointSize::SizeMode sizeMode, float value)
diff --git a/src/render/renderstates/qpolygonoffset_p.h b/src/render/renderstates/qpolygonoffset_p.h
index d1dc67530..66a62674e 100644
--- a/src/render/renderstates/qpolygonoffset_p.h
+++ b/src/render/renderstates/qpolygonoffset_p.h
@@ -50,12 +50,13 @@
#include <Qt3DRender/private/qrenderstate_p.h>
#include <Qt3DRender/qpolygonoffset.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QPolygonOffsetPrivate : public QRenderStatePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QPolygonOffsetPrivate : public QRenderStatePrivate
{
public:
QPolygonOffsetPrivate()
diff --git a/src/render/renderstates/qscissortest_p.h b/src/render/renderstates/qscissortest_p.h
index e5bbaad13..7c7bfdfe0 100644
--- a/src/render/renderstates/qscissortest_p.h
+++ b/src/render/renderstates/qscissortest_p.h
@@ -50,12 +50,13 @@
#include <Qt3DRender/private/qrenderstate_p.h>
#include <Qt3DRender/qscissortest.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QScissorTestPrivate : public QRenderStatePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QScissorTestPrivate : public QRenderStatePrivate
{
public:
QScissorTestPrivate()
diff --git a/src/render/renderstates/qstencilmask_p.h b/src/render/renderstates/qstencilmask_p.h
index 2333476b7..a6aad60b9 100644
--- a/src/render/renderstates/qstencilmask_p.h
+++ b/src/render/renderstates/qstencilmask_p.h
@@ -50,12 +50,13 @@
#include <Qt3DRender/private/qrenderstate_p.h>
#include <Qt3DRender/qstencilmask.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QStencilMaskPrivate : public QRenderStatePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QStencilMaskPrivate : public QRenderStatePrivate
{
public:
QStencilMaskPrivate()
diff --git a/src/render/renderstates/qstenciloperation_p.h b/src/render/renderstates/qstenciloperation_p.h
index b6f9d5958..3273ada23 100644
--- a/src/render/renderstates/qstenciloperation_p.h
+++ b/src/render/renderstates/qstenciloperation_p.h
@@ -52,12 +52,13 @@
#include <Qt3DRender/qstenciloperation.h>
#include <Qt3DRender/qstenciloperationarguments.h>
#include <Qt3DRender/private/qstenciloperationarguments_p.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QStencilOperationPrivate : public QRenderStatePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QStencilOperationPrivate : public QRenderStatePrivate
{
public:
QStencilOperationPrivate()
diff --git a/src/render/renderstates/qstenciloperationarguments_p.h b/src/render/renderstates/qstenciloperationarguments_p.h
index a0082c60b..3babd3373 100644
--- a/src/render/renderstates/qstenciloperationarguments_p.h
+++ b/src/render/renderstates/qstenciloperationarguments_p.h
@@ -50,12 +50,13 @@
#include <QtCore/private/qobject_p.h>
#include <Qt3DRender/qstenciloperationarguments.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QStencilOperationArgumentsPrivate : public QObjectPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QStencilOperationArgumentsPrivate : public QObjectPrivate
{
public:
QStencilOperationArgumentsPrivate(QStencilOperationArguments::FaceMode mode)
diff --git a/src/render/renderstates/qstenciltest_p.h b/src/render/renderstates/qstenciltest_p.h
index 67f465c69..fc17cfde8 100644
--- a/src/render/renderstates/qstenciltest_p.h
+++ b/src/render/renderstates/qstenciltest_p.h
@@ -52,12 +52,13 @@
#include <Qt3DRender/qstenciltest.h>
#include <Qt3DRender/qstenciltestarguments.h>
#include <Qt3DRender/private/qstenciltestarguments_p.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QStencilTestPrivate : public QRenderStatePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QStencilTestPrivate : public QRenderStatePrivate
{
public:
QStencilTestPrivate()
diff --git a/src/render/renderstates/qstenciltestarguments_p.h b/src/render/renderstates/qstenciltestarguments_p.h
index 06a5bb91a..662301843 100644
--- a/src/render/renderstates/qstenciltestarguments_p.h
+++ b/src/render/renderstates/qstenciltestarguments_p.h
@@ -50,12 +50,13 @@
#include <QtCore/private/qobject_p.h>
#include <Qt3DRender/qstenciltestarguments.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QStencilTestArgumentsPrivate : public QObjectPrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QStencilTestArgumentsPrivate : public QObjectPrivate
{
public:
QStencilTestArgumentsPrivate(QStencilTestArguments::StencilFaceMode face)
diff --git a/src/render/texture/qpaintedtextureimage_p.h b/src/render/texture/qpaintedtextureimage_p.h
index 4fcaa6c93..9db2f4d9c 100644
--- a/src/render/texture/qpaintedtextureimage_p.h
+++ b/src/render/texture/qpaintedtextureimage_p.h
@@ -54,6 +54,7 @@
#include <Qt3DRender/private/qabstracttextureimage_p.h>
#include <Qt3DRender/qtextureimagedatagenerator.h>
#include <Qt3DRender/qpaintedtextureimage.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
@@ -62,7 +63,7 @@ class QPainter;
namespace Qt3DRender {
-class QPaintedTextureImagePrivate : public QAbstractTextureImagePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QPaintedTextureImagePrivate : public QAbstractTextureImagePrivate
{
public:
QPaintedTextureImagePrivate();
diff --git a/src/render/texture/qtexture_p.h b/src/render/texture/qtexture_p.h
index 7035cfb33..2cdb4c689 100644
--- a/src/render/texture/qtexture_p.h
+++ b/src/render/texture/qtexture_p.h
@@ -54,12 +54,13 @@
#include <Qt3DRender/private/qabstracttexture_p.h>
#include <Qt3DRender/qtexturegenerator.h>
#include <Qt3DRender/qtexture.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QTextureLoaderPrivate : public QAbstractTexturePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QTextureLoaderPrivate : public QAbstractTexturePrivate
{
public:
QTextureLoaderPrivate();
diff --git a/src/render/texture/qtextureimage_p.h b/src/render/texture/qtextureimage_p.h
index 323742781..8db8f50f0 100644
--- a/src/render/texture/qtextureimage_p.h
+++ b/src/render/texture/qtextureimage_p.h
@@ -57,12 +57,13 @@
#include <Qt3DRender/qtextureimage.h>
#include <Qt3DRender/private/qurlhelper_p.h>
#include <Qt3DRender/qtextureimagedatagenerator.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QTextureImagePrivate : public QAbstractTextureImagePrivate
+class QT3DRENDERSHARED_PRIVATE_EXPORT QTextureImagePrivate : public QAbstractTextureImagePrivate
{
public:
QTextureImagePrivate()
diff --git a/tests/auto/animation/animationutils/animationutils.qrc b/tests/auto/animation/animationutils/animationutils.qrc
index bbcd96524..ddaeab7f1 100644
--- a/tests/auto/animation/animationutils/animationutils.qrc
+++ b/tests/auto/animation/animationutils/animationutils.qrc
@@ -3,5 +3,6 @@
<file>clip1.json</file>
<file>clip2.json</file>
<file>clip3.json</file>
+ <file>clip4.json</file>
</qresource>
</RCC>
diff --git a/tests/auto/animation/animationutils/clip4.json b/tests/auto/animation/animationutils/clip4.json
new file mode 100644
index 000000000..0915294cd
--- /dev/null
+++ b/tests/auto/animation/animationutils/clip4.json
@@ -0,0 +1,65 @@
+{
+ "animations": [
+ {
+ "animationName": "LinearTranslation",
+ "channels": [
+ {
+ "channelComponents": [
+ {
+ "channelComponentName": "Location X",
+ "keyFrames": [
+ {
+ "coords": [
+ 0.0,
+ 0.0
+ ]
+ },
+ {
+ "coords": [
+ 10.0,
+ 5.0
+ ]
+ }
+ ]
+ },
+ {
+ "channelComponentName": "Location Y",
+ "keyFrames": [
+ {
+ "coords": [
+ 0.0,
+ 0.0
+ ]
+ },
+ {
+ "coords": [
+ 10.0,
+ -2.0
+ ]
+ }
+ ]
+ },
+ {
+ "channelComponentName": "Location Z",
+ "keyFrames": [
+ {
+ "coords": [
+ 0.0,
+ 0.0
+ ]
+ },
+ {
+ "coords": [
+ 10.0,
+ 6.0
+ ]
+ }
+ ]
+ }
+ ],
+ "channelName": "Location"
+ }
+ ]
+ }
+ ]
+}
diff --git a/tests/auto/animation/animationutils/tst_animationutils.cpp b/tests/auto/animation/animationutils/tst_animationutils.cpp
index a70fd271c..4c97cf7e5 100644
--- a/tests/auto/animation/animationutils/tst_animationutils.cpp
+++ b/tests/auto/animation/animationutils/tst_animationutils.cpp
@@ -42,6 +42,7 @@
#include <QtGui/qvector3d.h>
#include <QtGui/qvector4d.h>
#include <QtGui/qquaternion.h>
+#include <QtGui/qcolor.h>
#include <qbackendnodetester.h>
#include <testpostmanarbiter.h>
@@ -1000,7 +1001,7 @@ private Q_SLOTS:
MappingData mapping;
mapping.targetId = Qt3DCore::QNodeId::createId();
mapping.propertyName = "foo";
- mapping.type = static_cast<int>(QVariant::Vector2D);
+ mapping.type = static_cast<int>(QVariant::Vector4D);
mapping.channelIndices = QVector<int>() << 0 << 1 << 2 << 3;
mappingData.push_back(mapping);
channelResults = QVector<float>() << 4.0f << 3.0f << 2.0f << 1.0f;
@@ -1036,7 +1037,7 @@ private Q_SLOTS:
auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(mapping.targetId);
change->setDeliveryFlags(Qt3DCore::QSceneChange::DeliverToAll);
change->setPropertyName(mapping.propertyName);
- change->setValue(QVariant::fromValue(QQuaternion(1.0f, 0.0f, 0.0f, 1.0f)));
+ change->setValue(QVariant::fromValue(QQuaternion(1.0f, 0.0f, 0.0f, 1.0f).normalized()));
expectedChanges.push_back(change);
QTest::newRow("quaternion rotation")
@@ -1047,6 +1048,34 @@ private Q_SLOTS:
channelResults.clear();
expectedChanges.clear();
}
+
+ // Single property, QColor
+ {
+ animatorId = Qt3DCore::QNodeId::createId();
+ MappingData mapping;
+ mapping.targetId = Qt3DCore::QNodeId::createId();
+ mapping.propertyName = "color";
+ mapping.type = static_cast<int>(QVariant::Color);
+ mapping.channelIndices = QVector<int>() << 0 << 1 << 2;
+ mappingData.push_back(mapping);
+ channelResults = QVector<float>() << 0.5f << 0.4f << 0.3f;
+ finalFrame = false;
+
+ auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(mapping.targetId);
+ change->setDeliveryFlags(Qt3DCore::QSceneChange::DeliverToAll);
+ change->setPropertyName(mapping.propertyName);
+ change->setValue(QVariant::fromValue(QColor::fromRgbF(0.5f, 0.4f, 0.3f)));
+ expectedChanges.push_back(change);
+
+ QTest::newRow("QColor color")
+ << animatorId << mappingData << channelResults << finalFrame
+ << expectedChanges;
+
+ mappingData.clear();
+ channelResults.clear();
+ expectedChanges.clear();
+ }
+
}
void checkPreparePropertyChanges()
@@ -1067,7 +1096,7 @@ private Q_SLOTS:
for (int i = 0; i < actualChanges.size(); ++i) {
auto expectedChange = expectedChanges[i];
auto actualChange
- = qSharedPointerCast<Qt3DCore::QPropertyUpdatedChange>(expectedChanges[i]);
+ = qSharedPointerCast<Qt3DCore::QPropertyUpdatedChange>(actualChanges[i]);
QCOMPARE(actualChange->subjectId(), expectedChange->subjectId());
QCOMPARE(actualChange->deliveryFlags(), expectedChange->deliveryFlags());
@@ -1157,6 +1186,28 @@ private Q_SLOTS:
<< handler << clip << localTime << expectedResults;
expectedResults.clear();
}
+ {
+ // a clip with linear interpolation
+ handler = new Handler();
+ clip = createAnimationClipLoader(handler, QUrl("qrc:/clip4.json"));
+ localTime = clip->duration();
+ expectedResults = QVector<float>() << 5.0 << -2.0f << 6.0f;
+
+ QTest::newRow("clip4.json, linear, t = duration")
+ << handler << clip << localTime << expectedResults;
+ expectedResults.clear();
+ }
+ {
+ // a clip with linear interpolation
+ handler = new Handler();
+ clip = createAnimationClipLoader(handler, QUrl("qrc:/clip4.json"));
+ localTime = clip->duration() / 2.0f;
+ expectedResults = QVector<float>() << 2.5f << -1.0f << 3.0f;
+
+ QTest::newRow("clip4.json, linear, t = duration/2")
+ << handler << clip << localTime << expectedResults;
+ expectedResults.clear();
+ }
}
void checkEvaluateClipAtLocalTime()
diff --git a/tests/auto/quick3d/quick3dnodeinstantiator/data/createNested.qml b/tests/auto/quick3d/quick3dnodeinstantiator/data/createNested.qml
new file mode 100644
index 000000000..55be54297
--- /dev/null
+++ b/tests/auto/quick3d/quick3dnodeinstantiator/data/createNested.qml
@@ -0,0 +1,15 @@
+import QtQml 2.1
+import Qt3D.Core 2.0
+
+Entity {
+ NodeInstantiator {
+ model: 3
+ delegate: NodeInstantiator {
+ model: 4
+ delegate: Entity {
+ property bool success: true
+ property int idx: index
+ }
+ }
+ }
+}
diff --git a/tests/auto/quick3d/quick3dnodeinstantiator/quick3dnodeinstantiator.pro b/tests/auto/quick3d/quick3dnodeinstantiator/quick3dnodeinstantiator.pro
index 15435d13e..9026f91ff 100644
--- a/tests/auto/quick3d/quick3dnodeinstantiator/quick3dnodeinstantiator.pro
+++ b/tests/auto/quick3d/quick3dnodeinstantiator/quick3dnodeinstantiator.pro
@@ -12,6 +12,7 @@ OTHER_FILES = \
data/createMultiple.qml \
data/createNone.qml \
data/createSingle.qml \
+ data/createNested.qml \
data/inactive.qml \
data/stringModel.qml
diff --git a/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp b/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp
index acaba6690..d4d0d56e2 100644
--- a/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp
+++ b/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp
@@ -50,6 +50,7 @@ private slots:
void createNone();
void createSingle();
void createMultiple();
+ void createNested();
void stringModel();
void activeProperty();
void intModelChange();
@@ -109,6 +110,34 @@ void tst_quick3dnodeinstantiator::createMultiple()
}
}
+void tst_quick3dnodeinstantiator::createNested()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("createNested.qml"));
+ const auto root = qobject_cast<Qt3DCore::QNode*>(component.create());
+ QVERIFY(root != 0);
+
+ auto instantiators = root->findChildren<Quick3DNodeInstantiator*>();
+ QCOMPARE(instantiators.count(), 4);
+
+ const auto outerInstantiator = instantiators.takeFirst();
+ QCOMPARE(outerInstantiator->isActive(), true);
+ QCOMPARE(outerInstantiator->count(), 3);
+
+ for (const auto instantiator : instantiators) {
+ QCOMPARE(instantiator->isActive(), true);
+ QCOMPARE(instantiator->count(), 4);
+
+ for (int i = 0; i < 4; i++) {
+ auto object = instantiator->objectAt(i);
+ QVERIFY(object);
+ QCOMPARE(object->parent(), root);
+ QCOMPARE(object->property("success").toBool(), true);
+ QCOMPARE(object->property("idx").toInt(), i);
+ }
+ }
+}
+
void tst_quick3dnodeinstantiator::stringModel()
{
QQmlEngine engine;