summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2019-09-19 09:09:17 +0200
committerPaul Lemire <paul.lemire@kdab.com>2019-09-19 09:53:24 +0200
commitcd61b4129a6556590b25c67dee65270b10c9db7e (patch)
treeb1d33b8e35b872e39d5d15506d95a418d0734cbd
parentd7857a310b86b22340acbfb569fd18b7c647d171 (diff)
QTransform: move setWorldMatrix to private class
Change-Id: Ifc8b172414e01cebcaf42c30773376c43aaae9a9 Task-number: QTBUG-77859 Reviewed-by: Mike Krus <mike.krus@kdab.com>
-rw-r--r--src/core/transforms/qtransform.cpp13
-rw-r--r--src/core/transforms/qtransform.h1
-rw-r--r--src/core/transforms/qtransform_p.h2
3 files changed, 9 insertions, 7 deletions
diff --git a/src/core/transforms/qtransform.cpp b/src/core/transforms/qtransform.cpp
index bedf108f2..e5902f11f 100644
--- a/src/core/transforms/qtransform.cpp
+++ b/src/core/transforms/qtransform.cpp
@@ -239,12 +239,13 @@ QTransform::QTransform(QTransformPrivate &dd, QNode *parent)
*/
void QTransform::sceneChangeEvent(const QSceneChangePtr &change)
{
+ Q_D(QTransform);
switch (change->type()) {
case PropertyUpdated: {
Qt3DCore::QPropertyUpdatedChangePtr propertyChange = qSharedPointerCast<Qt3DCore::QPropertyUpdatedChange>(change);
if (propertyChange->propertyName() == QByteArrayLiteral("worldMatrix")) {
const bool blocked = blockNotifications(true);
- setWorldMatrix(propertyChange->value().value<QMatrix4x4>());
+ d->setWorldMatrix(propertyChange->value().value<QMatrix4x4>());
blockNotifications(blocked);
}
break;
@@ -254,13 +255,13 @@ void QTransform::sceneChangeEvent(const QSceneChangePtr &change)
}
}
-void QTransform::setWorldMatrix(const QMatrix4x4 &worldMatrix)
+void QTransformPrivate::setWorldMatrix(const QMatrix4x4 &worldMatrix)
{
- Q_D(QTransform);
- if (d->m_worldMatrix == worldMatrix)
+ Q_Q(QTransform);
+ if (m_worldMatrix == worldMatrix)
return;
- d->m_worldMatrix = worldMatrix;
- emit worldMatrixChanged(worldMatrix);
+ m_worldMatrix = worldMatrix;
+ emit q->worldMatrixChanged(worldMatrix);
}
void QTransform::setMatrix(const QMatrix4x4 &m)
diff --git a/src/core/transforms/qtransform.h b/src/core/transforms/qtransform.h
index 527760df7..503ea4d4a 100644
--- a/src/core/transforms/qtransform.h
+++ b/src/core/transforms/qtransform.h
@@ -120,7 +120,6 @@ Q_SIGNALS:
protected:
explicit QTransform(QTransformPrivate &dd, QNode *parent = nullptr);
void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) override;
- void setWorldMatrix(const QMatrix4x4 &worldMatrix);
private:
Q_DECLARE_PRIVATE(QTransform)
diff --git a/src/core/transforms/qtransform_p.h b/src/core/transforms/qtransform_p.h
index d44e5e157..028a9aba7 100644
--- a/src/core/transforms/qtransform_p.h
+++ b/src/core/transforms/qtransform_p.h
@@ -77,6 +77,8 @@ public:
mutable bool m_matrixDirty;
QMatrix4x4 m_worldMatrix;
+
+ void setWorldMatrix(const QMatrix4x4 &worldMatrix);
};
struct QTransformData