summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Brock <robert.brock@kdab.com>2016-02-24 14:32:40 +0000
committerRobert Brock <robert.brock@kdab.com>2016-02-25 11:46:24 +0000
commitdfe0d0cb24a554455f774741e06e1cbd50831b1a (patch)
tree3fbf552a54f3fcd9c2332568300ec9c9f62ffb44
parent143b1c9a0993c371941919acbe52c76f7636502e (diff)
Remove QRenderAttachment name property
As per API review, name property is not needed as we can simply use the QObject::objectName property. Change-Id: I575c658a4af68145b50ad03e55971856479225e6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r--examples/qt3d/deferred-renderer-cpp/gbuffer.cpp8
-rw-r--r--examples/qt3d/deferred-renderer-qml/GBuffer.qml8
-rw-r--r--src/render/backend/renderattachment.cpp9
-rw-r--r--src/render/backend/renderattachment_p.h1
-rw-r--r--src/render/frontend/qrenderattachment.cpp15
-rw-r--r--src/render/frontend/qrenderattachment.h4
-rw-r--r--src/render/frontend/qrenderattachment_p.h1
7 files changed, 4 insertions, 42 deletions
diff --git a/examples/qt3d/deferred-renderer-cpp/gbuffer.cpp b/examples/qt3d/deferred-renderer-cpp/gbuffer.cpp
index da128f784..cdf47d119 100644
--- a/examples/qt3d/deferred-renderer-cpp/gbuffer.cpp
+++ b/examples/qt3d/deferred-renderer-cpp/gbuffer.cpp
@@ -67,13 +67,6 @@ GBuffer::GBuffer(Qt3DCore::QNode *parent)
Qt3DRender::QRenderAttachment::DepthAttachment
};
- const QString attachmentNames[AttachmentsCount] = {
- QString::fromLatin1("color"),
- QString::fromLatin1("position"),
- QString::fromLatin1("normal"),
- QString::fromLatin1("depth")
- };
-
for (int i = 0; i < AttachmentsCount; i++) {
Qt3DRender::QRenderAttachment *attachment = new Qt3DRender::QRenderAttachment(this);
@@ -88,7 +81,6 @@ GBuffer::GBuffer(Qt3DCore::QNode *parent)
attachment->setTexture(m_textures[i]);
attachment->setType(attachmentTypes[i]);
- attachment->setName(attachmentNames[i]);
addAttachment(attachment);
}
diff --git a/examples/qt3d/deferred-renderer-qml/GBuffer.qml b/examples/qt3d/deferred-renderer-qml/GBuffer.qml
index e7c5fe82c..3104307a4 100644
--- a/examples/qt3d/deferred-renderer-qml/GBuffer.qml
+++ b/examples/qt3d/deferred-renderer-qml/GBuffer.qml
@@ -61,7 +61,7 @@ RenderTarget {
attachments : [
RenderAttachment {
- name : "color"
+ objectName : "color"
type : RenderAttachment.ColorAttachment0
texture : Texture2D {
id : colorAttachment
@@ -78,7 +78,7 @@ RenderTarget {
}
},
RenderAttachment {
- name : "position"
+ objectName : "position"
type : RenderAttachment.ColorAttachment1
texture : Texture2D {
id : positionAttachment
@@ -97,7 +97,7 @@ RenderTarget {
}
},
RenderAttachment {
- name : "normal"
+ objectName : "normal"
type : RenderAttachment.ColorAttachment2
texture : Texture2D {
id : normalAttachment
@@ -116,7 +116,7 @@ RenderTarget {
}
},
RenderAttachment {
- name : "depth"
+ objectName : "depth"
type : RenderAttachment.DepthAttachment
texture : Texture2D {
id : depthAttachment
diff --git a/src/render/backend/renderattachment.cpp b/src/render/backend/renderattachment.cpp
index 44ee3bb60..fd2b43926 100644
--- a/src/render/backend/renderattachment.cpp
+++ b/src/render/backend/renderattachment.cpp
@@ -62,7 +62,6 @@ void RenderAttachment::updateFromPeer(Qt3DCore::QNode *peer)
m_attachmentData.m_layer = attachment->layer();
m_attachmentData.m_type = attachment->type();
m_attachmentData.m_face = attachment->face();
- m_attachmentData.m_name = attachment->name();
if (attachment->texture())
m_attachmentData.m_textureUuid = attachment->texture()->id();
}
@@ -82,11 +81,6 @@ int RenderAttachment::layer() const
return m_attachmentData.m_layer;
}
-QString RenderAttachment::name() const
-{
- return m_attachmentData.m_name;
-}
-
QRenderAttachment::CubeMapFace RenderAttachment::face() const
{
return m_attachmentData.m_face;
@@ -116,9 +110,6 @@ void RenderAttachment::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e)
else if (propertyChange->propertyName() == QByteArrayLiteral("face")) {
m_attachmentData.m_face = static_cast<QRenderAttachment::CubeMapFace>(propertyChange->value().toInt());
}
- else if (propertyChange->propertyName() == QByteArrayLiteral("name")) {
- m_attachmentData.m_name = propertyChange->value().toString();
- }
markDirty(BackendNodeDirtyFlag::Any);
}
}
diff --git a/src/render/backend/renderattachment_p.h b/src/render/backend/renderattachment_p.h
index 6d820160b..693c0e4c0 100644
--- a/src/render/backend/renderattachment_p.h
+++ b/src/render/backend/renderattachment_p.h
@@ -75,7 +75,6 @@ public:
Qt3DCore::QNodeId textureUuid() const;
int mipLevel() const;
int layer() const;
- QString name() const;
QRenderAttachment::CubeMapFace face() const;
QRenderAttachment::RenderAttachmentType type() const;
void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) Q_DECL_OVERRIDE;
diff --git a/src/render/frontend/qrenderattachment.cpp b/src/render/frontend/qrenderattachment.cpp
index 7236d0e5a..149cf952c 100644
--- a/src/render/frontend/qrenderattachment.cpp
+++ b/src/render/frontend/qrenderattachment.cpp
@@ -158,21 +158,6 @@ QRenderAttachment::CubeMapFace QRenderAttachment::face() const
return d->m_face;
}
-void QRenderAttachment::setName(const QString &name)
-{
- Q_D(QRenderAttachment);
- if (d->m_name != name) {
- d->m_name = name;
- emit nameChanged(name);
- }
-}
-
-QString QRenderAttachment::name() const
-{
- Q_D(const QRenderAttachment);
- return d->m_name;
-}
-
} // namespace Qt3DRender
QT_END_NAMESPACE
diff --git a/src/render/frontend/qrenderattachment.h b/src/render/frontend/qrenderattachment.h
index 92dd5f774..6fb020958 100644
--- a/src/render/frontend/qrenderattachment.h
+++ b/src/render/frontend/qrenderattachment.h
@@ -58,7 +58,6 @@ class QT3DRENDERSHARED_EXPORT QRenderAttachment : public Qt3DCore::QNode
Q_PROPERTY(int mipLevel READ mipLevel WRITE setMipLevel NOTIFY mipLevelChanged)
Q_PROPERTY(int layer READ layer WRITE setLayer NOTIFY layerChanged)
Q_PROPERTY(CubeMapFace face READ face WRITE setFace NOTIFY faceChanged)
- Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
public:
enum RenderAttachmentType {
@@ -102,7 +101,6 @@ public:
int mipLevel() const;
int layer() const;
CubeMapFace face() const;
- QString name() const;
public Q_SLOTS:
void setType(RenderAttachmentType type);
@@ -110,7 +108,6 @@ public Q_SLOTS:
void setMipLevel(int level);
void setLayer(int layer);
void setFace(CubeMapFace face);
- void setName(const QString &name);
Q_SIGNALS:
void typeChanged(RenderAttachmentType type);
@@ -118,7 +115,6 @@ Q_SIGNALS:
void mipLevelChanged(int mipLevel);
void layerChanged(int layer);
void faceChanged(CubeMapFace face);
- void nameChanged(const QString &name);
protected:
QRenderAttachment(QRenderAttachmentPrivate &dd, Qt3DCore::QNode *parent = 0);
diff --git a/src/render/frontend/qrenderattachment_p.h b/src/render/frontend/qrenderattachment_p.h
index c8eba826f..065e02093 100644
--- a/src/render/frontend/qrenderattachment_p.h
+++ b/src/render/frontend/qrenderattachment_p.h
@@ -72,7 +72,6 @@ public:
int m_mipLevel;
int m_layer;
QRenderAttachment::CubeMapFace m_face;
- QString m_name;
};
} // namespace Qt3DRender