Update the creator template files to follow latest API

Change-Id: I8d6144a25963390b78ed9273a02b65b8e9cb37c4
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
This commit is contained in:
Sean Harmer 2017-01-06 15:53:00 +00:00
parent 168df684fa
commit 9ff925c821
3 changed files with 19 additions and 11 deletions

View File

@ -22,19 +22,19 @@ QT_BEGIN_NAMESPACE
%{CN}::~%{CN}()
{
QNode::cleanup();
}
@else
// TODO: Implement QBackendNode template
@endif
@if '%{Base}' === 'QNode' || '%{Base}' === 'QComponent' || '%{Base}' === 'QEntity'
void %{CN}::copy(const QNode *ref)
Qt3DCore::QNodeCreatedChangeBasePtr %{CN}::createNodeCreationChange() const
{
%{Base}::copy(ref);
const %{CN} *object = static_cast<const %{CN} *>(ref);
// TODO: Copy the objects's members
auto creationChange = Qt3DCore::QNodeCreatedChangePtr<%{CN}Data>::create(this);
auto &data = creationChange->data;
Q_D(const %{CN});
// TODO: Send data members in creation change
return creationChange;
}
@endif
%{JS: Cpp.closeNamespaces('%{Class}')}\

View File

@ -29,7 +29,7 @@ class %{CN}
@endif
public:
@if '%{Base}' === 'QNode' || '%{Base}' === 'QComponent' || '%{Base}' === 'QEntity'
explicit %{CN}(Qt3DCore::QNode *parent = 0);
explicit %{CN}(Qt3DCore::QNode *parent = nullptr);
@else
%{CN}();
@endif
@ -41,12 +41,11 @@ Q_SIGNALS:
@if '%{Base}' === 'QNode' || '%{Base}' === 'QComponent' || '%{Base}' === 'QEntity'
protected:
Q_DECLARE_PRIVATE(%{CN})
%{CN}(%{CN}Private &dd, Qt3DCore::QNode *parent = 0);
void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE;
%{CN}(%{CN}Private &dd, Qt3DCore::QNode *parent = nullptr);
private:
QT3D_CLONEABLE(%{CN})
Q_DECLARE_PRIVATE(%{CN})
Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE;
@endif
};
%{JS: Cpp.closeNamespaces('%{Class}')}

View File

@ -31,8 +31,17 @@ class %{CN}Private : public Qt3DCore::%{Base}Private
public:
%{CN}Private();
Q_DECLARE_PUBLIC(%{CN})
// TODO Add member variables
};
@if '%{Base}' === 'QNode' || '%{Base}' === 'QComponent'
struct %{CN}Data
{
// TODO: Add members that should be sent to the backend
};
@endif
%{JS: Cpp.closeNamespaces('%{Class}')}
QT_END_NAMESPACE