summaryrefslogtreecommitdiffstats
path: root/scripts/templates/qclass.cpp
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2013-09-04 07:26:59 -0300
committerSandro S. Andrade <sandroandrade@kde.org>2013-09-04 12:24:26 +0200
commitdf7fb2f660e151d0c5fbe62f90be9437ed190087 (patch)
treed001e89e61a00cd00e23b2b6a042bc55aed150d0 /scripts/templates/qclass.cpp
parentc9b9fb27ccfef6f23ce89eb7a54ed1ffa0bdd697 (diff)
Add clone() method in template files
Change-Id: I345f997a2002bb97d4d243e4b2286865728292d8 Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'scripts/templates/qclass.cpp')
-rw-r--r--scripts/templates/qclass.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/templates/qclass.cpp b/scripts/templates/qclass.cpp
index 8e755719..70ca0bab 100644
--- a/scripts/templates/qclass.cpp
+++ b/scripts/templates/qclass.cpp
@@ -135,6 +135,17 @@ Q${namespace}${className}::~Q${namespace}${className}()
}
[%- END %]
}
+
+QModelingObject *Q${namespace}${className}::clone() const
+{
+ Q${namespace}${className} *c = new Q${namespace}${className};
+[%- visitedClasses = [] -%]
+[%- redefinedProperties = [] -%]
+[%- POPULATE_REDEFINED_PROPERTIES(class, visitedClasses, redefinedProperties) -%]
+[%- visitedClasses = [] -%]
+[%- GENERATE_CLONE(class, visitedClasses, redefinedProperties) %]
+ return c;
+}
[%- FOREACH attribute = class.findnodes("ownedAttribute") %]
[%- IF loop.first %]