diff options
author | Kevin Ottens <kevin.ottens@kdab.com> | 2016-04-26 09:56:42 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-04-28 07:50:56 +0000 |
commit | e1b2b6d0660fc73ca339d3a0e9bb62b2dc79126a (patch) | |
tree | 5c6ac3373549da0a7c50d5119d2757fdafa60219 | |
parent | 7d124092eb40dac7829475a36f748688af2e47dc (diff) |
Rename QLight to QAbstractLight
Change-Id: I3ee3f6e3c9eef554fce7d79407825894b1be2450
Task-number: QTBUG-51489
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
21 files changed, 103 insertions, 103 deletions
diff --git a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp b/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp index 5959a58e4..20cad743f 100644 --- a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp +++ b/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp @@ -56,7 +56,7 @@ #include <Qt3DRender/qfilterkey.h> #include <Qt3DRender/qlayer.h> #include <Qt3DRender/qlayerfilter.h> -#include <Qt3DRender/qlight.h> +#include <Qt3DRender/qabstractlight.h> #include <Qt3DRender/qspotlight.h> #include <Qt3DRender/qdirectionallight.h> #include <Qt3DRender/qpointlight.h> @@ -209,7 +209,7 @@ void Qt3DQuick3DRenderPlugin::registerTypes(const char *uri) qmlRegisterType<Qt3DRender::QLayerFilter>(uri, 2, 0, "LayerFilter"); // Lights - qmlRegisterType<Qt3DRender::QLight>(uri, 2, 0, "Light"); + qmlRegisterType<Qt3DRender::QAbstractLight>(uri, 2, 0, "Light"); qmlRegisterType<Qt3DRender::QPointLight>(uri, 2, 0, "PointLight"); qmlRegisterType<Qt3DRender::QDirectionalLight>(uri, 2, 0, "DirectionalLight"); qmlRegisterType<Qt3DRender::QSpotLight>(uri, 2, 0, "SpotLight"); diff --git a/src/render/backend/entity.cpp b/src/render/backend/entity.cpp index cb44276f5..92d0f64ea 100644 --- a/src/render/backend/entity.cpp +++ b/src/render/backend/entity.cpp @@ -40,7 +40,7 @@ #include "entity_p.h" #include <Qt3DRender/private/managers_p.h> #include <Qt3DRender/private/nodemanagers_p.h> -#include <Qt3DRender/qlight.h> +#include <Qt3DRender/qabstractlight.h> #include <Qt3DRender/qlayer.h> #include <Qt3DRender/qmaterial.h> #include <Qt3DRender/qmesh.h> @@ -308,7 +308,7 @@ void Entity::addComponent(Qt3DCore::QComponent *component) m_layerComponents.append(component->id()); } else if (qobject_cast<QMaterial *>(component) != Q_NULLPTR) { m_materialComponent = component->id(); - } else if (qobject_cast<QLight *>(component) != Q_NULLPTR) { // QLight subclasses QShaderData + } else if (qobject_cast<QAbstractLight *>(component) != Q_NULLPTR) { // QAbstractLight subclasses QShaderData m_lightComponents.append(component->id()); } else if (qobject_cast<QShaderData *>(component) != Q_NULLPTR) { m_shaderDataComponents.append(component->id()); @@ -339,7 +339,7 @@ void Entity::addComponent(Qt3DCore::QNodeIdTypePair idAndType) m_layerComponents.append(id); } else if (type->inherits(&QMaterial::staticMetaObject)) { m_materialComponent = id; - } else if (type->inherits(&QLight::staticMetaObject)) { // QLight subclasses QShaderData + } else if (type->inherits(&QAbstractLight::staticMetaObject)) { // QAbstractLight subclasses QShaderData m_lightComponents.append(id); } else if (type->inherits(&QShaderData::staticMetaObject)) { m_shaderDataComponents.append(id); diff --git a/src/render/backend/renderview.cpp b/src/render/backend/renderview.cpp index d516343e9..cc8cddbb8 100644 --- a/src/render/backend/renderview.cpp +++ b/src/render/backend/renderview.cpp @@ -42,7 +42,7 @@ #include <Qt3DRender/qmaterial.h> #include <Qt3DRender/qrenderaspect.h> #include <Qt3DRender/qrendertarget.h> -#include <Qt3DRender/qlight.h> +#include <Qt3DRender/qabstractlight.h> #include <Qt3DRender/private/sphere_p.h> #include <Qt3DRender/private/cameraselectornode_p.h> @@ -869,7 +869,7 @@ void RenderView::setShaderAndUniforms(RenderCommand *command, RenderPass *rPass, if (lightIdx == MAX_LIGHTS) break; setUniformValue(command->m_parameterPack, LIGHT_POSITION_NAMES[lightIdx], worldPos); - setUniformValue(command->m_parameterPack, LIGHT_TYPE_NAMES[lightIdx], int(QLight::PointLight)); + setUniformValue(command->m_parameterPack, LIGHT_TYPE_NAMES[lightIdx], int(QAbstractLight::PointLight)); setUniformValue(command->m_parameterPack, LIGHT_COLOR_NAMES[lightIdx], QVector3D(1.0f, 1.0f, 1.0f)); setUniformValue(command->m_parameterPack, LIGHT_INTENSITY_NAMES[lightIdx], QVector3D(0.5f, 0.5f, 0.5f)); setDefaultUniformBlockShaderDataValue(command->m_parameterPack, shader, light, LIGHT_STRUCT_NAMES[lightIdx]); @@ -882,7 +882,7 @@ void RenderView::setShaderAndUniforms(RenderCommand *command, RenderPass *rPass, if (activeLightSources.isEmpty()) { setUniformValue(command->m_parameterPack, LIGHT_POSITION_NAMES[0], QVector3D(10.0f, 10.0f, 0.0f)); - setUniformValue(command->m_parameterPack, LIGHT_TYPE_NAMES[0], int(QLight::PointLight)); + setUniformValue(command->m_parameterPack, LIGHT_TYPE_NAMES[0], int(QAbstractLight::PointLight)); setUniformValue(command->m_parameterPack, LIGHT_COLOR_NAMES[0], QVector3D(1.0f, 1.0f, 1.0f)); setUniformValue(command->m_parameterPack, LIGHT_INTENSITY_NAMES[0], QVector3D(0.5f, 0.5f, 0.5f)); } diff --git a/src/render/frontend/qrenderaspect.cpp b/src/render/frontend/qrenderaspect.cpp index a51627ac8..d27a36080 100644 --- a/src/render/frontend/qrenderaspect.cpp +++ b/src/render/frontend/qrenderaspect.cpp @@ -71,7 +71,7 @@ #include <Qt3DRender/qgeometryrenderer.h> #include <Qt3DRender/qobjectpicker.h> #include <Qt3DRender/qfrustumculling.h> -#include <Qt3DRender/qlight.h> +#include <Qt3DRender/qabstractlight.h> #include <Qt3DRender/qdispatchcompute.h> #include <Qt3DRender/qcomputecommand.h> #include <Qt3DRender/qrendersurfaceselector.h> @@ -203,7 +203,7 @@ void QRenderAspectPrivate::registerBackendTypes() // Material system q->registerBackendType<QEffect>(QBackendNodeMapperPtr(new Render::NodeFunctor<Render::Effect, Render::EffectManager>(m_renderer, m_nodeManagers->effectManager()))); q->registerBackendType<QFilterKey>(QBackendNodeMapperPtr(new Render::NodeFunctor<Render::FilterKey, Render::FilterKeyManager>(m_renderer, m_nodeManagers->filterKeyManager()))); - q->registerBackendType<QLight>(QBackendNodeMapperPtr(new Render::RenderLightFunctor(m_renderer, m_nodeManagers))); + q->registerBackendType<QAbstractLight>(QBackendNodeMapperPtr(new Render::RenderLightFunctor(m_renderer, m_nodeManagers))); q->registerBackendType<QMaterial>(QBackendNodeMapperPtr(new Render::NodeFunctor<Render::Material, Render::MaterialManager>(m_renderer, m_nodeManagers->materialManager()))); q->registerBackendType<QParameter>(QBackendNodeMapperPtr(new Render::NodeFunctor<Render::Parameter, Render::ParameterManager>(m_renderer, m_nodeManagers->parameterManager()))); q->registerBackendType<QRenderPass>(QBackendNodeMapperPtr(new Render::NodeFunctor<Render::RenderPass, Render::RenderPassManager>(m_renderer, m_nodeManagers->renderPassManager()))); diff --git a/src/render/lights/light.cpp b/src/render/lights/light.cpp index 9193462cb..8485ad48e 100644 --- a/src/render/lights/light.cpp +++ b/src/render/lights/light.cpp @@ -38,7 +38,7 @@ ****************************************************************************/ #include "light_p.h" -#include "qlight.h" +#include "qabstractlight.h" #include <Qt3DCore/qnodepropertychange.h> #include <private/abstractrenderer_p.h> #include <private/nodemanagers_p.h> diff --git a/src/render/lights/lights.pri b/src/render/lights/lights.pri index ade6d29d7..1a7e8295c 100644 --- a/src/render/lights/lights.pri +++ b/src/render/lights/lights.pri @@ -1,8 +1,8 @@ INCLUDEPATH += $$PWD HEADERS += \ - $$PWD/qlight.h \ - $$PWD/qlight_p.h \ + $$PWD/qabstractlight.h \ + $$PWD/qabstractlight_p.h \ $$PWD/qdirectionallight.h \ $$PWD/qdirectionallight_p.h \ $$PWD/qpointlight.h \ @@ -12,7 +12,7 @@ HEADERS += \ $$PWD/light_p.h SOURCES += \ - $$PWD/qlight.cpp \ + $$PWD/qabstractlight.cpp \ $$PWD/qdirectionallight.cpp \ $$PWD/qpointlight.cpp \ $$PWD/qspotlight.cpp \ diff --git a/src/render/lights/qlight.cpp b/src/render/lights/qabstractlight.cpp index f86e709e4..604fdf4eb 100644 --- a/src/render/lights/qlight.cpp +++ b/src/render/lights/qabstractlight.cpp @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#include "qlight.h" -#include "qlight_p.h" +#include "qabstractlight.h" +#include "qabstractlight_p.h" QT_BEGIN_NAMESPACE @@ -48,22 +48,22 @@ namespace Qt3DRender /*! * \qmltype Light * \inqmlmodule Qt3D.Render - * \instantiates Qt3DRender::QLight - * \brief Encapsulate a QLight object in a Qt 3D scene. + * \instantiates Qt3DRender::QAbstractLight + * \brief Encapsulate a QAbstractLight object in a Qt 3D scene. * \since 5.6 */ -QLightPrivate::QLightPrivate(QLight::Type type) +QAbstractLightPrivate::QAbstractLightPrivate(QAbstractLight::Type type) : m_type(type) , m_color(QColor(255, 255, 255)) , m_intensity(1.0f) { } -void QLight::copy(const QNode *ref) +void QAbstractLight::copy(const QNode *ref) { - const QLight *light = static_cast<const QLight*>(ref); + const QAbstractLight *light = static_cast<const QAbstractLight*>(ref); d_func()->m_type = light->d_func()->m_type; d_func()->m_color = light->d_func()->m_color; d_func()->m_intensity = light->d_func()->m_intensity; @@ -71,33 +71,33 @@ void QLight::copy(const QNode *ref) } /*! - \class Qt3DRender::QLight + \class Qt3DRender::QAbstractLight \inmodule Qt3DRender */ /*! - * Constructs a new QLight with the given \a parent. + * Constructs a new QAbstractLight with the given \a parent. */ -QLight::QLight(Qt3DCore::QNode *parent) : - QShaderData(*new QLightPrivate(PointLight), parent) +QAbstractLight::QAbstractLight(Qt3DCore::QNode *parent) : + QShaderData(*new QAbstractLightPrivate(PointLight), parent) { } /*! \internal */ -QLight::QLight(QLightPrivate &dd, QNode *parent) +QAbstractLight::QAbstractLight(QAbstractLightPrivate &dd, QNode *parent) : QShaderData(dd, parent) { } -QLight::Type QLight::type() const +QAbstractLight::Type QAbstractLight::type() const { - Q_D(const QLight); + Q_D(const QAbstractLight); return d->m_type; } -void QLight::setType(Type type) +void QAbstractLight::setType(Type type) { - Q_D(QLight); + Q_D(QAbstractLight); if (d->m_type != type) { d->m_type = type; emit typeChanged(type); @@ -105,19 +105,19 @@ void QLight::setType(Type type) } /*! - * \property Qt3DRender::QLight::color + * \property Qt3DRender::QAbstractLight::color * - * Holds the current QLight color. + * Holds the current QAbstractLight color. */ -QColor QLight::color() const +QColor QAbstractLight::color() const { - Q_D(const QLight); + Q_D(const QAbstractLight); return d->m_color; } -void QLight::setColor(const QColor &color) +void QAbstractLight::setColor(const QColor &color) { - Q_D(QLight); + Q_D(QAbstractLight); if (d->m_color != color) { d->m_color = color; emit colorChanged(color); @@ -125,19 +125,19 @@ void QLight::setColor(const QColor &color) } /*! - \property Qt3DRender::QLight::intensity + \property Qt3DRender::QAbstractLight::intensity - Holds the current QLight intensity. + Holds the current QAbstractLight intensity. */ -float QLight::intensity() const +float QAbstractLight::intensity() const { - Q_D(const QLight); + Q_D(const QAbstractLight); return d->m_intensity; } -void QLight::setIntensity(float intensity) +void QAbstractLight::setIntensity(float intensity) { - Q_D(QLight); + Q_D(QAbstractLight); if (d->m_intensity != intensity) { d->m_intensity = intensity; emit intensityChanged(intensity); diff --git a/src/render/lights/qlight.h b/src/render/lights/qabstractlight.h index 369d35526..15a7ed069 100644 --- a/src/render/lights/qlight.h +++ b/src/render/lights/qabstractlight.h @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#ifndef QT3DRENDER_QLIGHT_H -#define QT3DRENDER_QLIGHT_H +#ifndef QT3DRENDER_QABSTRACTLIGHT_H +#define QT3DRENDER_QABSTRACTLIGHT_H #include <Qt3DRender/qt3drender_global.h> #include <Qt3DRender/qshaderdata.h> @@ -50,9 +50,9 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { -class QLightPrivate; +class QAbstractLightPrivate; -class QT3DRENDERSHARED_EXPORT QLight : public QShaderData +class QT3DRENDERSHARED_EXPORT QAbstractLight : public QShaderData { Q_OBJECT Q_PROPERTY(Type type READ type WRITE setType NOTIFY typeChanged) @@ -67,7 +67,7 @@ public : }; Q_ENUM(Type) - explicit QLight(Qt3DCore::QNode *parent = Q_NULLPTR); + explicit QAbstractLight(Qt3DCore::QNode *parent = Q_NULLPTR); Type type() const; QColor color() const; @@ -79,7 +79,7 @@ public Q_SLOTS: void setIntensity(float intensity); protected : - QLight(QLightPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); + QAbstractLight(QAbstractLightPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; Q_SIGNALS: @@ -88,12 +88,12 @@ Q_SIGNALS: void intensityChanged(float intensity); private: - Q_DECLARE_PRIVATE(QLight) - QT3D_CLONEABLE(QLight) + Q_DECLARE_PRIVATE(QAbstractLight) + QT3D_CLONEABLE(QAbstractLight) }; } // namespace Qt3DRender QT_END_NAMESPACE -#endif // QT3DRENDER_QLIGHT_H +#endif // QT3DRENDER_QABSTRACTLIGHT_H diff --git a/src/render/lights/qlight_p.h b/src/render/lights/qabstractlight_p.h index f21939f03..3f3b4cc0d 100644 --- a/src/render/lights/qlight_p.h +++ b/src/render/lights/qabstractlight_p.h @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#ifndef QT3DRENDER_QLIGHT_P_H -#define QT3DRENDER_QLIGHT_P_H +#ifndef QT3DRENDER_QABSTRACTLIGHT_P_H +#define QT3DRENDER_QABSTRACTLIGHT_P_H // // W A R N I N G @@ -57,15 +57,15 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { -class QLight; +class QAbstractLight; -class QLightPrivate : public QShaderDataPrivate +class QAbstractLightPrivate : public QShaderDataPrivate { public: - QLightPrivate(QLight::Type type); + QAbstractLightPrivate(QAbstractLight::Type type); - Q_DECLARE_PUBLIC(QLight) - QLight::Type m_type; + Q_DECLARE_PUBLIC(QAbstractLight) + QAbstractLight::Type m_type; QColor m_color; float m_intensity; }; @@ -74,4 +74,4 @@ public: QT_END_NAMESPACE -#endif // QT3DRENDER_QLIGHT_P_H +#endif // QT3DRENDER_QABSTRACTLIGHT_P_H diff --git a/src/render/lights/qdirectionallight.cpp b/src/render/lights/qdirectionallight.cpp index e5265a0fb..ff1ca1a8d 100644 --- a/src/render/lights/qdirectionallight.cpp +++ b/src/render/lights/qdirectionallight.cpp @@ -65,7 +65,7 @@ namespace Qt3DRender { */ QDirectionalLightPrivate::QDirectionalLightPrivate() - : QLightPrivate(QLight::DirectionalLight) + : QAbstractLightPrivate(QAbstractLight::DirectionalLight) , m_worldDirection(0.0f, -1.0f, 0.0f) { } @@ -76,17 +76,17 @@ void QDirectionalLight::copy(const QNode *ref) d_func()->m_worldDirection = light->d_func()->m_worldDirection; // This needs to be last otherwise, properties value won't be copied // as we use shader introspection in QShaderData::copy - QLight::copy(ref); + QAbstractLight::copy(ref); } QDirectionalLight::QDirectionalLight(QNode *parent) - : QLight(*new QDirectionalLightPrivate, parent) + : QAbstractLight(*new QDirectionalLightPrivate, parent) { } /*! \internal */ QDirectionalLight::QDirectionalLight(QDirectionalLightPrivate &dd, QNode *parent) - : QLight(dd, parent) + : QAbstractLight(dd, parent) { } diff --git a/src/render/lights/qdirectionallight.h b/src/render/lights/qdirectionallight.h index 636a5a00b..ec2e960db 100644 --- a/src/render/lights/qdirectionallight.h +++ b/src/render/lights/qdirectionallight.h @@ -40,7 +40,7 @@ #ifndef QT3DRENDER_QDIRECTIONALLIGHT_H #define QT3DRENDER_QDIRECTIONALLIGHT_H -#include <Qt3DRender/qlight.h> +#include <Qt3DRender/qabstractlight.h> QT_BEGIN_NAMESPACE @@ -48,7 +48,7 @@ namespace Qt3DRender { class QDirectionalLightPrivate; -class QT3DRENDERSHARED_EXPORT QDirectionalLight : public QLight +class QT3DRENDERSHARED_EXPORT QDirectionalLight : public QAbstractLight { Q_OBJECT Q_PROPERTY(QVector3D worldDirection READ worldDirection WRITE setWorldDirection NOTIFY worldDirectionChanged) diff --git a/src/render/lights/qdirectionallight_p.h b/src/render/lights/qdirectionallight_p.h index 486458180..b560e4348 100644 --- a/src/render/lights/qdirectionallight_p.h +++ b/src/render/lights/qdirectionallight_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include <private/qlight_p.h> +#include <private/qabstractlight_p.h> QT_BEGIN_NAMESPACE @@ -59,7 +59,7 @@ namespace Qt3DRender { class QDirectionalLight; -class QDirectionalLightPrivate : QLightPrivate +class QDirectionalLightPrivate : QAbstractLightPrivate { public: QDirectionalLightPrivate(); diff --git a/src/render/lights/qpointlight.cpp b/src/render/lights/qpointlight.cpp index 57b276c6f..86455be84 100644 --- a/src/render/lights/qpointlight.cpp +++ b/src/render/lights/qpointlight.cpp @@ -61,11 +61,11 @@ namespace Qt3DRender { \endcode */ -QPointLightPrivate::QPointLightPrivate(QLight::Type type) - : QLightPrivate(type) +QPointLightPrivate::QPointLightPrivate(QAbstractLight::Type type) + : QAbstractLightPrivate(type) , m_constantAttenuation(0.0f) , m_linearAttenuation(0.0f) - , m_quadraticAttenuation(0.002f) + , m_quadraticAttenuation(0.0f) { } @@ -90,13 +90,13 @@ QPointLightPrivate::QPointLightPrivate(QLight::Type type) Constructs a new QPointLight with the specified \a parent. */ QPointLight::QPointLight(QNode *parent) - : QLight(*new QPointLightPrivate, parent) + : QAbstractLight(*new QPointLightPrivate, parent) { } /*! \internal */ QPointLight::QPointLight(QPointLightPrivate &dd, QNode *parent) - : QLight(dd, parent) + : QAbstractLight(dd, parent) { } diff --git a/src/render/lights/qpointlight.h b/src/render/lights/qpointlight.h index 7298997d2..972a19b20 100644 --- a/src/render/lights/qpointlight.h +++ b/src/render/lights/qpointlight.h @@ -40,7 +40,7 @@ #ifndef QT3DRENDER_QPOINTLIGHT_H #define QT3DRENDER_QPOINTLIGHT_H -#include <Qt3DRender/qlight.h> +#include <Qt3DRender/qabstractlight.h> QT_BEGIN_NAMESPACE @@ -48,7 +48,7 @@ namespace Qt3DRender { class QPointLightPrivate; -class QT3DRENDERSHARED_EXPORT QPointLight : public QLight +class QT3DRENDERSHARED_EXPORT QPointLight : public QAbstractLight { Q_OBJECT Q_PROPERTY(float constantAttenuation READ constantAttenuation WRITE setConstantAttenuation NOTIFY constantAttenuationChanged) diff --git a/src/render/lights/qpointlight_p.h b/src/render/lights/qpointlight_p.h index 74f32910b..1a08b1d0c 100644 --- a/src/render/lights/qpointlight_p.h +++ b/src/render/lights/qpointlight_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include <private/qlight_p.h> +#include <private/qabstractlight_p.h> QT_BEGIN_NAMESPACE @@ -59,10 +59,10 @@ namespace Qt3DRender { class QPointLight; -class QPointLightPrivate : public QLightPrivate +class QPointLightPrivate : public QAbstractLightPrivate { public: - QPointLightPrivate(QLight::Type type = QLight::PointLight); + QPointLightPrivate(QAbstractLight::Type type = QAbstractLight::PointLight); float m_constantAttenuation; float m_linearAttenuation; diff --git a/src/render/lights/qspotlight.cpp b/src/render/lights/qspotlight.cpp index cb94e2bf5..55e3c079e 100644 --- a/src/render/lights/qspotlight.cpp +++ b/src/render/lights/qspotlight.cpp @@ -66,10 +66,10 @@ namespace Qt3DRender { */ QSpotLightPrivate::QSpotLightPrivate() - : QLightPrivate(QLight::SpotLight) + : QAbstractLightPrivate(QAbstractLight::SpotLight) , m_constantAttenuation(0.0f) , m_linearAttenuation(0.0f) - , m_quadraticAttenuation(0.002f) + , m_quadraticAttenuation(0.0f) , m_localDirection(0.0f, -1.0f, 0.0f) , m_cutOffAngle(45.0f) { @@ -100,7 +100,7 @@ void QSpotLight::copy(const QNode *ref) const QSpotLight *light = static_cast<const QSpotLight*>(ref); d_func()->m_localDirection = light->d_func()->m_localDirection; d_func()->m_cutOffAngle = light->d_func()->m_cutOffAngle; - QLight::copy(ref); + QAbstractLight::copy(ref); } @@ -109,13 +109,13 @@ void QSpotLight::copy(const QNode *ref) Constructs a new QSpotLight with the specified \a parent. */ QSpotLight::QSpotLight(QNode *parent) - : QLight(*new QSpotLightPrivate, parent) + : QAbstractLight(*new QSpotLightPrivate, parent) { } /*! \internal */ QSpotLight::QSpotLight(QSpotLightPrivate &dd, QNode *parent) - : QLight(dd, parent) + : QAbstractLight(dd, parent) { } diff --git a/src/render/lights/qspotlight.h b/src/render/lights/qspotlight.h index a02809082..3d7889156 100644 --- a/src/render/lights/qspotlight.h +++ b/src/render/lights/qspotlight.h @@ -40,7 +40,7 @@ #ifndef QT3DRENDER_QSPOTLIGHT_H #define QT3DRENDER_QSPOTLIGHT_H -#include <Qt3DRender/qlight.h> +#include <Qt3DRender/qabstractlight.h> QT_BEGIN_NAMESPACE @@ -48,7 +48,7 @@ namespace Qt3DRender { class QSpotLightPrivate; -class QT3DRENDERSHARED_EXPORT QSpotLight : public QLight +class QT3DRENDERSHARED_EXPORT QSpotLight : public QAbstractLight { Q_OBJECT Q_PROPERTY(float constantAttenuation READ constantAttenuation WRITE setConstantAttenuation NOTIFY constantAttenuationChanged) diff --git a/src/render/lights/qspotlight_p.h b/src/render/lights/qspotlight_p.h index 20d9b6042..19a132b34 100644 --- a/src/render/lights/qspotlight_p.h +++ b/src/render/lights/qspotlight_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include <private/qlight_p.h> +#include <private/qabstractlight_p.h> QT_BEGIN_NAMESPACE @@ -59,7 +59,7 @@ namespace Qt3DRender { class QSpotLight; -class QSpotLightPrivate : public QLightPrivate +class QSpotLightPrivate : public QAbstractLightPrivate { public: QSpotLightPrivate(); diff --git a/tests/auto/render/qlight/qlight.pro b/tests/auto/render/qabstractlight/qabstractlight.pro index 5f2bd10b4..764681f1d 100644 --- a/tests/auto/render/qlight/qlight.pro +++ b/tests/auto/render/qabstractlight/qabstractlight.pro @@ -1,11 +1,11 @@ TEMPLATE = app -TARGET = tst_qlight +TARGET = tst_qabstractlight QT += core-private 3dcore 3dcore-private 3drender 3drender-private testlib CONFIG += testcase -SOURCES += tst_qlight.cpp +SOURCES += tst_qabstractlight.cpp include(../commons/commons.pri) diff --git a/tests/auto/render/qlight/tst_qlight.cpp b/tests/auto/render/qabstractlight/tst_qabstractlight.cpp index 31d827870..552a15a48 100644 --- a/tests/auto/render/qlight/tst_qlight.cpp +++ b/tests/auto/render/qabstractlight/tst_qabstractlight.cpp @@ -30,7 +30,7 @@ #include <Qt3DCore/private/qnode_p.h> #include <Qt3DCore/private/qscene_p.h> -#include <Qt3DRender/qlight.h> +#include <Qt3DRender/qabstractlight.h> #include <Qt3DRender/qpointlight.h> #include <Qt3DRender/qdirectionallight.h> #include <Qt3DRender/qspotlight.h> @@ -39,11 +39,11 @@ // We need to call QNode::clone which is protected // So we sublcass QNode instead of QObject -class tst_QLight: public Qt3DCore::QNode +class tst_QAbstractLight: public Qt3DCore::QNode { Q_OBJECT public: - ~tst_QLight() + ~tst_QAbstractLight() { QMetaObject::invokeMethod(this, "_q_cleanup", Qt::DirectConnection); } @@ -52,11 +52,11 @@ private Q_SLOTS: void checkLightCloning() { - Qt3DRender::QLight light; + Qt3DRender::QAbstractLight light; light.setColor(Qt::red); light.setIntensity(0.5f); - QScopedPointer<Qt3DRender::QLight> lightClone(static_cast<Qt3DRender::QLight *>(QNode::clone(&light))); + QScopedPointer<Qt3DRender::QAbstractLight> lightClone(static_cast<Qt3DRender::QAbstractLight *>(QNode::clone(&light))); QVERIFY(lightClone.data()); QCOMPARE(light.color(), lightClone->color()); QCOMPARE(light.intensity(), lightClone->intensity()); @@ -65,7 +65,7 @@ private Q_SLOTS: void checkPointLightCloning() { Qt3DRender::QPointLight pointLight; - QCOMPARE(pointLight.type(), Qt3DRender::QLight::PointLight); + QCOMPARE(pointLight.type(), Qt3DRender::QAbstractLight::PointLight); pointLight.setColor(Qt::green); pointLight.setIntensity(0.5f); pointLight.setConstantAttenuation(0.5f); @@ -74,7 +74,7 @@ private Q_SLOTS: QScopedPointer<Qt3DRender::QPointLight> pointLightClone(static_cast<Qt3DRender::QPointLight *>(QNode::clone(&pointLight))); QVERIFY(pointLightClone.data()); - QCOMPARE(pointLightClone->type(), Qt3DRender::QLight::PointLight); + QCOMPARE(pointLightClone->type(), Qt3DRender::QAbstractLight::PointLight); QCOMPARE(pointLight.color(), pointLightClone->color()); QCOMPARE(pointLight.intensity(), pointLightClone->intensity()); QCOMPARE(pointLight.constantAttenuation(), pointLightClone->constantAttenuation()); @@ -85,14 +85,14 @@ private Q_SLOTS: void checkDirectionalLightCloning() { Qt3DRender::QDirectionalLight dirLight; - QCOMPARE(dirLight.type(), Qt3DRender::QLight::DirectionalLight); + QCOMPARE(dirLight.type(), Qt3DRender::QAbstractLight::DirectionalLight); dirLight.setColor(Qt::blue); dirLight.setIntensity(0.5f); dirLight.setWorldDirection(QVector3D(0, 0, -1)); QScopedPointer<Qt3DRender::QDirectionalLight> dirLightClone(static_cast<Qt3DRender::QDirectionalLight *>(QNode::clone(&dirLight))); QVERIFY(dirLightClone.data()); - QCOMPARE(dirLightClone->type(), Qt3DRender::QLight::DirectionalLight); + QCOMPARE(dirLightClone->type(), Qt3DRender::QAbstractLight::DirectionalLight); QCOMPARE(dirLight.color(), dirLightClone->color()); QCOMPARE(dirLight.intensity(), dirLightClone->intensity()); QCOMPARE(dirLight.worldDirection(), dirLightClone->worldDirection()); @@ -101,7 +101,7 @@ private Q_SLOTS: void checkSpotLightCloning() { Qt3DRender::QSpotLight spotLight; - QCOMPARE(spotLight.type(), Qt3DRender::QLight::SpotLight); + QCOMPARE(spotLight.type(), Qt3DRender::QAbstractLight::SpotLight); spotLight.setColor(Qt::lightGray); spotLight.setIntensity(0.5f); spotLight.setLocalDirection(QVector3D(0, 0, -1)); @@ -109,7 +109,7 @@ private Q_SLOTS: QScopedPointer<Qt3DRender::QSpotLight> spotLightClone(static_cast<Qt3DRender::QSpotLight *>(QNode::clone(&spotLight))); QVERIFY(spotLightClone.data()); - QCOMPARE(spotLightClone->type(), Qt3DRender::QLight::SpotLight); + QCOMPARE(spotLightClone->type(), Qt3DRender::QAbstractLight::SpotLight); QCOMPARE(spotLight.color(), spotLightClone->color()); QCOMPARE(spotLight.intensity(), spotLightClone->intensity()); QCOMPARE(spotLight.localDirection(), spotLightClone->localDirection()); @@ -118,7 +118,7 @@ private Q_SLOTS: void checkLightPropertyUpdates() { - QScopedPointer<Qt3DRender::QLight> light(new Qt3DRender::QLight); + QScopedPointer<Qt3DRender::QAbstractLight> light(new Qt3DRender::QAbstractLight); TestArbiter lightArbiter(light.data()); light->setColor(Qt::red); @@ -258,6 +258,6 @@ protected: }; -QTEST_MAIN(tst_QLight) +QTEST_MAIN(tst_QAbstractLight) -#include "tst_qlight.moc" +#include "tst_qabstractlight.moc" diff --git a/tests/auto/render/render.pro b/tests/auto/render/render.pro index 27da4bc42..a429c77f0 100644 --- a/tests/auto/render/render.pro +++ b/tests/auto/render/render.pro @@ -26,7 +26,7 @@ contains(QT_CONFIG, private_tests) { qclearbuffers \ qframegraphnode \ qlayerfilter \ - qlight \ + qabstractlight \ qray3d \ qrenderpassfilter \ qrendertargetselector \ |