diff options
author | Jere Tuliniemi <jere.tuliniemi@qt.io> | 2019-08-13 09:18:32 +0300 |
---|---|---|
committer | Jere Tuliniemi <jere.tuliniemi@qt.io> | 2019-08-13 11:51:56 +0300 |
commit | d2a1092b93e9669288dc1d5825bfec849bec9f95 (patch) | |
tree | bb309388747c58f677f91e974bbd6ff5edd42dab | |
parent | bd488ea03ec4a969e86c55909c60deecdc9f9af2 (diff) |
Change Float4 to use QVector4D
This fixes a bug on the editor side and makes Float4 be in line with the
other types using QVector3D and QVector2D.
Task-number: QT3DS-3824
Change-Id: Iee04c56575e91afa1e3e27ed02abbe50a72231e0
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r-- | src/dm/systems/Qt3DSDMValue.cpp | 2 | ||||
-rw-r--r-- | src/dm/systems/Qt3DSDMValue.h | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/dm/systems/Qt3DSDMValue.cpp b/src/dm/systems/Qt3DSDMValue.cpp index 32a389c..57ba400 100644 --- a/src/dm/systems/Qt3DSDMValue.cpp +++ b/src/dm/systems/Qt3DSDMValue.cpp @@ -114,7 +114,7 @@ QVariant SValue::toQVariant() const return QVariant::fromValue(get<QVector3D>(*this)); } case DataModelDataType::Float4: { - return QVariant::fromValue(get<QVector<float> >(*this)); + return QVariant::fromValue(get<QVector4D>(*this)); } case DataModelDataType::Long: { return QVariant::fromValue(get<qt3ds::QT3DSI32>(*this)); diff --git a/src/dm/systems/Qt3DSDMValue.h b/src/dm/systems/Qt3DSDMValue.h index 9e00632..b66499b 100644 --- a/src/dm/systems/Qt3DSDMValue.h +++ b/src/dm/systems/Qt3DSDMValue.h @@ -37,6 +37,7 @@ #include <QVector> #include <QVector2D> #include <QVector3D> +#include <QVector4D> namespace qt3dsdm { @@ -322,10 +323,10 @@ inline QVector3D get<QVector3D>(const qt3dsdm::SValue &inType) } template <> -inline QVector<float> get<QVector<float> >(const qt3dsdm::SValue &inType) +inline QVector4D get<QVector4D>(const qt3dsdm::SValue &inType) { auto f = get<qt3dsdm::SFloat4>(inType); - return {f.m_Floats[0], f.m_Floats[1], f.m_Floats[2], f.m_Floats[3]}; + return QVector4D(f.m_Floats[0], f.m_Floats[1], f.m_Floats[2], f.m_Floats[3]); } // KDAB_TODO Shortcut to not define our own 4 member long structure |