summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2017-01-06 15:53:00 +0000
committerSean Harmer <sean.harmer@kdab.com>2017-01-11 09:05:46 +0000
commit9ff925c8217f6e54d52c3906c044ce5f1307a45b (patch)
tree3f1a056e15700f4195ae44d1eaf5fba5cbbee4f7 /tools
parent168df684faec35dd8422c03d53dc6954805c7425 (diff)
Update the creator template files to follow latest API
Change-Id: I8d6144a25963390b78ed9273a02b65b8e9cb37c4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/utils/qtcreator/templates/wizards/classes/qt3d/file.cpp12
-rw-r--r--tools/utils/qtcreator/templates/wizards/classes/qt3d/file.h9
-rw-r--r--tools/utils/qtcreator/templates/wizards/classes/qt3d/file_p.h9
3 files changed, 19 insertions, 11 deletions
diff --git a/tools/utils/qtcreator/templates/wizards/classes/qt3d/file.cpp b/tools/utils/qtcreator/templates/wizards/classes/qt3d/file.cpp
index 03d99bdbc..4200859a9 100644
--- a/tools/utils/qtcreator/templates/wizards/classes/qt3d/file.cpp
+++ b/tools/utils/qtcreator/templates/wizards/classes/qt3d/file.cpp
@@ -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}')}\
diff --git a/tools/utils/qtcreator/templates/wizards/classes/qt3d/file.h b/tools/utils/qtcreator/templates/wizards/classes/qt3d/file.h
index 7d2e76326..9060461eb 100644
--- a/tools/utils/qtcreator/templates/wizards/classes/qt3d/file.h
+++ b/tools/utils/qtcreator/templates/wizards/classes/qt3d/file.h
@@ -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}')}
diff --git a/tools/utils/qtcreator/templates/wizards/classes/qt3d/file_p.h b/tools/utils/qtcreator/templates/wizards/classes/qt3d/file_p.h
index 71203930e..9de21e805 100644
--- a/tools/utils/qtcreator/templates/wizards/classes/qt3d/file_p.h
+++ b/tools/utils/qtcreator/templates/wizards/classes/qt3d/file_p.h
@@ -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