summaryrefslogtreecommitdiffstats
path: root/scripts/templates/common.tmpl
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2013-10-09 20:19:34 -0300
committerSandro S. Andrade <sandroandrade@kde.org>2013-10-10 01:23:16 +0200
commitdc76a0dc87fe7ee0f94e96881990a4e83911fd8e (patch)
treef5b0731e183ecfe8c8d0a888a966508984d921db /scripts/templates/common.tmpl
parent01ae27fe58be35914b0c4f573782f90242a9bfd9 (diff)
Further refactoring in QtModeling (initial step)
Change-Id: Id8ca8a50edefeeb5c71206e96adbc4777eb82ccd Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'scripts/templates/common.tmpl')
-rw-r--r--scripts/templates/common.tmpl10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/templates/common.tmpl b/scripts/templates/common.tmpl
index 75b1a0b7..a9d5089c 100644
--- a/scripts/templates/common.tmpl
+++ b/scripts/templates/common.tmpl
@@ -469,20 +469,22 @@ void Q${namespace}${originalClassName}Object::unset${qtAttribute.remove("^is").u
[%- END -%]
[%- END %]
[%- END -%]
-[%- MACRO SET_CLASS_FOR_PROPERTY(class, visitedClasses, redefinedProperties) BLOCK -%]
+[%- MACRO SET_GROUP_PROPERTIES(class, visitedClasses, redefinedProperties) BLOCK -%]
[%- FOREACH parent IN class.findnodes("generalization") -%]
[%- SET parentName = parent.findvalue("@general") -%]
[%- IF visitedClasses.grep("^${parentName}$").size == 0 -%]
[%- visitedClasses.push("${parentName}") -%]
- [%- SET_CLASS_FOR_PROPERTY(xmi.findnodes("//packagedElement[@xmi:type=\"uml:Class\" and @name=\"${parentName}\"]"), visitedClasses, redefinedProperties) -%]
+ [%- SET_GROUP_PROPERTIES(xmi.findnodes("//packagedElement[@xmi:type=\"uml:Class\" and @name=\"${parentName}\"]"), visitedClasses, redefinedProperties) -%]
[%- END -%]
[%- END -%]
-[%- SET className = class.findvalue("@name") -%]
+[%- SET className = class.findvalue("@name") %]
+
+ _propertyGroups << QStringLiteral("Q${namespace}${className}");
[%- FOREACH attribute = class.findnodes("ownedAttribute") -%]
[%- SET qtType = QT_TYPE(namespace, attribute) -%]
[%- SET attributeName = attribute.findvalue("@name") -%]
[%- SET qtAttribute = QT_ATTRIBUTE(attribute) -%]
[%- NEXT IF redefinedProperties.grep("^${className}-${qtAttribute}$").size > 0 %]
- _classForProperty[QStringLiteral("${PLURALFORM(qtAttribute, attribute)}")] = QStringLiteral("Q${namespace}${className}");
+ _groupProperties.insert(QStringLiteral("Q${namespace}${className}"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("${PLURALFORM(qtAttribute, attribute)}"))));
[%- END %]
[%- END -%] \ No newline at end of file