diff options
author | Tomi Korpipää <tomi.korpipaa@theqtcompany.com> | 2015-12-08 11:50:37 +0200 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@theqtcompany.com> | 2015-12-09 05:18:19 +0000 |
commit | 0e15154c9f0d982096a551efc53fd363d2b2f68d (patch) | |
tree | 4917ca73c44a92297db7cc3dbd72d2716481ccc7 /src/render/lights | |
parent | 036ea9fcfdd343c805e1a900528e7a2367d6c373 (diff) |
Added parameters to signals and made setters Q_SLOTS
Change-Id: Icec2f9f207221e35ffdeeb594bb9b4dc6ef890f1
Task-number: QTBUG-49797
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/lights')
-rw-r--r-- | src/render/lights/qdirectionallight.cpp | 2 | ||||
-rw-r--r-- | src/render/lights/qdirectionallight.h | 6 | ||||
-rw-r--r-- | src/render/lights/qlight.cpp | 6 | ||||
-rw-r--r-- | src/render/lights/qlight.h | 14 | ||||
-rw-r--r-- | src/render/lights/qpointlight.cpp | 8 | ||||
-rw-r--r-- | src/render/lights/qpointlight.h | 6 | ||||
-rw-r--r-- | src/render/lights/qspotlight.cpp | 4 | ||||
-rw-r--r-- | src/render/lights/qspotlight.h | 5 |
8 files changed, 28 insertions, 23 deletions
diff --git a/src/render/lights/qdirectionallight.cpp b/src/render/lights/qdirectionallight.cpp index 206b720b0..9a5dfdd97 100644 --- a/src/render/lights/qdirectionallight.cpp +++ b/src/render/lights/qdirectionallight.cpp @@ -96,7 +96,7 @@ void QDirectionalLight::setDirection(const QVector3D &direction) Q_D(QDirectionalLight); if (direction != d->m_direction) { d->m_direction = direction; - emit directionChanged(); + emit directionChanged(direction); } } diff --git a/src/render/lights/qdirectionallight.h b/src/render/lights/qdirectionallight.h index c2af37ea5..bffb601a5 100644 --- a/src/render/lights/qdirectionallight.h +++ b/src/render/lights/qdirectionallight.h @@ -53,11 +53,13 @@ class QT3DRENDERSHARED_EXPORT QDirectionalLight : public QLight public: explicit QDirectionalLight(Qt3DCore::QNode *parent = 0); - void setDirection(const QVector3D &direction); QVector3D direction() const; +public Q_SLOTS: + void setDirection(const QVector3D &direction); + Q_SIGNALS: - void directionChanged(); + void directionChanged(const QVector3D &direction); protected: QDirectionalLight(QDirectionalLightPrivate &dd, Qt3DCore::QNode *parent = 0); diff --git a/src/render/lights/qlight.cpp b/src/render/lights/qlight.cpp index 55fe1415a..77cf4efe1 100644 --- a/src/render/lights/qlight.cpp +++ b/src/render/lights/qlight.cpp @@ -106,7 +106,7 @@ void QLight::setType(Type type) Q_D(QLight); if (d->m_type != type) { d->m_type = type; - emit typeChanged(); + emit typeChanged(type); } } @@ -126,7 +126,7 @@ void QLight::setColor(const QColor &color) Q_D(QLight); if (d->m_color != color) { d->m_color = color; - emit colorChanged(); + emit colorChanged(color); } } @@ -146,7 +146,7 @@ void QLight::setIntensity(float intensity) Q_D(QLight); if (d->m_intensity != intensity) { d->m_intensity = intensity; - emit intensityChanged(); + emit intensityChanged(intensity); } } diff --git a/src/render/lights/qlight.h b/src/render/lights/qlight.h index d1ce2e463..febff442c 100644 --- a/src/render/lights/qlight.h +++ b/src/render/lights/qlight.h @@ -68,12 +68,12 @@ public : ~QLight(); Type type() const; - void setType(Type type); - QColor color() const; - void setColor(const QColor &color); - float intensity() const; + +public Q_SLOTS: + void setType(Type type); + void setColor(const QColor &color); void setIntensity(float intensity); protected : @@ -81,9 +81,9 @@ protected : void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; Q_SIGNALS: - void typeChanged(); - void colorChanged(); - void intensityChanged(); + void typeChanged(Type type); + void colorChanged(const QColor &color); + void intensityChanged(float intensity); private: Q_DECLARE_PRIVATE(QLight) diff --git a/src/render/lights/qpointlight.cpp b/src/render/lights/qpointlight.cpp index d795a9914..05fb85676 100644 --- a/src/render/lights/qpointlight.cpp +++ b/src/render/lights/qpointlight.cpp @@ -110,7 +110,7 @@ void QPointLight::setAttenuation(const QVector3D &value) Q_D(QPointLight); if (d->m_attenuation != value) { d->m_attenuation = value; - emit attenuationChanged(); + emit attenuationChanged(value); } } @@ -125,7 +125,7 @@ void QPointLight::setConstantAttenuation(float value) Q_D(QPointLight); if (d->m_attenuation.x() != value) { d->m_attenuation.setX(value); - emit attenuationChanged(); + emit attenuationChanged(d->m_attenuation); } } @@ -140,7 +140,7 @@ void QPointLight::setLinearAttenuation(float value) Q_D(QPointLight); if (d->m_attenuation.y() != value) { d->m_attenuation.setY(value); - emit attenuationChanged(); + emit attenuationChanged(d->m_attenuation); } } @@ -155,7 +155,7 @@ void QPointLight::setQuadraticAttenuation(float value) Q_D(QPointLight); if (d->m_attenuation.z() != value) { d->m_attenuation.setZ(value); - emit attenuationChanged(); + emit attenuationChanged(d->m_attenuation); } } diff --git a/src/render/lights/qpointlight.h b/src/render/lights/qpointlight.h index 75b4671d0..62e8ebcb6 100644 --- a/src/render/lights/qpointlight.h +++ b/src/render/lights/qpointlight.h @@ -54,7 +54,6 @@ public: explicit QPointLight(Qt3DCore::QNode *parent = 0); QVector3D attenuation() const; - void setAttenuation(const QVector3D &value); float constantAttenuation() const; void setConstantAttenuation(float value); @@ -65,8 +64,11 @@ public: float quadraticAttenuation() const; void setQuadraticAttenuation(float value); +public Q_SLOTS: + void setAttenuation(const QVector3D &value); + Q_SIGNALS: - void attenuationChanged(); + void attenuationChanged(const QVector3D &attenuation); protected: Q_DECLARE_PRIVATE(QPointLight) diff --git a/src/render/lights/qspotlight.cpp b/src/render/lights/qspotlight.cpp index 6b8bf6906..13c81b494 100644 --- a/src/render/lights/qspotlight.cpp +++ b/src/render/lights/qspotlight.cpp @@ -153,7 +153,7 @@ void QSpotLight::setDirection(const QVector3D &direction) Q_D(QSpotLight); if (direction != d->m_direction) { d->m_direction = direction; - emit directionChanged(); + emit directionChanged(direction); } } @@ -162,7 +162,7 @@ void QSpotLight::setCutOffAngle(float cutOffAngle) Q_D(QSpotLight); if (d->m_cutOffAngle != cutOffAngle) { d->m_cutOffAngle = cutOffAngle; - emit cutOffAngleChanged(); + emit cutOffAngleChanged(cutOffAngle); } } diff --git a/src/render/lights/qspotlight.h b/src/render/lights/qspotlight.h index 9a04b7925..edba764cc 100644 --- a/src/render/lights/qspotlight.h +++ b/src/render/lights/qspotlight.h @@ -57,12 +57,13 @@ public: QVector3D direction() const; float cutOffAngle() const; +public Q_SLOTS: void setDirection(const QVector3D &direction); void setCutOffAngle(float cutOffAngle); Q_SIGNALS: - void directionChanged(); - void cutOffAngleChanged(); + void directionChanged(const QVector3D &direction); + void cutOffAngleChanged(float cutOffAngle); protected: QSpotLight(QSpotLightPrivate &dd, Qt3DCore::QNode *parent = 0); |