Add clone() method in template files

Change-Id: I345f997a2002bb97d4d243e4b2286865728292d8
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>