summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/deferred-renderer-cpp
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2016-04-27 12:39:15 +0200
committerSean Harmer <sean.harmer@kdab.com>2016-04-28 11:28:56 +0000
commit42bc3d429a470ec678948a19da1af5a67fe0080c (patch)
treeadf2a31505fc9f45ff0385e24490645fc7b82acc /examples/qt3d/deferred-renderer-cpp
parent665afce109016328ce3702a9d116e250b250f6ef (diff)
QAbstractLight now inherits directly QComponent
We are turning the relationship between QAbstractLight and QShaderData from a "is-a" to a "has-a". For that we relay all the properties of the light to its internal shader data dynamic properties. Interestingly it also removes a couple of special handling for lights which aren't needed anymore. Change-Id: Ia937b8934f94ce318e02901d90ac340e172cbc75 Task-number: QTBUG-51489 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples/qt3d/deferred-renderer-cpp')
-rw-r--r--examples/qt3d/deferred-renderer-cpp/pointlightblock.cpp4
-rw-r--r--examples/qt3d/deferred-renderer-cpp/pointlightblock.h9
2 files changed, 7 insertions, 6 deletions
diff --git a/examples/qt3d/deferred-renderer-cpp/pointlightblock.cpp b/examples/qt3d/deferred-renderer-cpp/pointlightblock.cpp
index ca00a5108..36bab9966 100644
--- a/examples/qt3d/deferred-renderer-cpp/pointlightblock.cpp
+++ b/examples/qt3d/deferred-renderer-cpp/pointlightblock.cpp
@@ -60,12 +60,12 @@ PointLightBlock::~PointLightBlock()
{
}
-QVector<Qt3DRender::QShaderData *> PointLightBlock::lights() const
+QVector<Qt3DRender::QAbstractLight *> PointLightBlock::lights() const
{
return m_lights;
}
-void PointLightBlock::addLight(Qt3DRender::QShaderData *light)
+void PointLightBlock::addLight(Qt3DRender::QAbstractLight *light)
{
m_lights.append(light);
emit lightsChanged();
diff --git a/examples/qt3d/deferred-renderer-cpp/pointlightblock.h b/examples/qt3d/deferred-renderer-cpp/pointlightblock.h
index f2c664fad..9c93528c8 100644
--- a/examples/qt3d/deferred-renderer-cpp/pointlightblock.h
+++ b/examples/qt3d/deferred-renderer-cpp/pointlightblock.h
@@ -51,24 +51,25 @@
#ifndef POINTLIGHTBLOCK_H
#define POINTLIGHTBLOCK_H
+#include <Qt3DRender/QAbstractLight>
#include <Qt3DRender/QShaderData>
class PointLightBlock : public Qt3DRender::QShaderData
{
Q_OBJECT
- Q_PROPERTY(QVector<QShaderData *> lights READ lights NOTIFY lightsChanged)
+ Q_PROPERTY(QVector<Qt3DRender::QAbstractLight *> lights READ lights NOTIFY lightsChanged)
public:
explicit PointLightBlock(Qt3DCore::QNode *parent = 0);
~PointLightBlock();
- QVector<Qt3DRender::QShaderData *> lights() const;
- void addLight(Qt3DRender::QShaderData *light);
+ QVector<Qt3DRender::QAbstractLight *> lights() const;
+ void addLight(Qt3DRender::QAbstractLight *light);
Q_SIGNALS:
void lightsChanged();
private:
- QVector<Qt3DRender::QShaderData *> m_lights;
+ QVector<Qt3DRender::QAbstractLight *> m_lights;
};
#endif // POINTLIGHTBLOCK_H