diff options
| author | Sandro S. Andrade <sandroandrade@kde.org> | 2013-10-07 09:36:50 -0300 |
|---|---|---|
| committer | Sandro S. Andrade <sandroandrade@kde.org> | 2013-10-07 14:34:31 +0200 |
| commit | 5e4a780b40543fa12d6d9607e3193fb111c5ab84 (patch) | |
| tree | eb747784d9f3319d6ac7954eea269614aaad9277 /scripts/templates/qclass.cpp | |
| parent | 3031fe1254052bdeffec90ca76e2f3649a971ae7 (diff) | |
Improve property metadata information
Change-Id: Ia9a7db26b2e7b8696aa7b82aed93c0fa6ebad8ce
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'scripts/templates/qclass.cpp')
| -rw-r--r-- | scripts/templates/qclass.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/scripts/templates/qclass.cpp b/scripts/templates/qclass.cpp index 0f33637b..dbbf63b5 100644 --- a/scripts/templates/qclass.cpp +++ b/scripts/templates/qclass.cpp @@ -408,17 +408,17 @@ void Q${namespace}${className}::setPropertyData() [%- FOREACH attribute = class.findnodes("ownedAttribute") -%] [%- SET association = attribute.findvalue("@association") -%] [%- IF attribute.findvalue("@aggregation") == "composite" %] - QModelingObject::propertyDataHash[QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::AggregationRole] = QStringLiteral("composite"); + QModelingObject::propertyDataHash[QStringLiteral("Q${namespace}${className}")][QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::AggregationRole] = QStringLiteral("composite"); [%- ELSE %] - QModelingObject::propertyDataHash[QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::AggregationRole] = QStringLiteral("none"); + QModelingObject::propertyDataHash[QStringLiteral("Q${namespace}${className}")][QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::AggregationRole] = QStringLiteral("none"); [%- END %] - QModelingObject::propertyDataHash[QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::PropertyClassRole] = QStringLiteral("Q${namespace}${className}"); - QModelingObject::propertyDataHash[QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::IsDerivedRole] = [% IF attribute.findvalue("@isDerived") == "true" %]true[% ELSE %]false[% END %]; - QModelingObject::propertyDataHash[QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::IsDerivedUnionRole] = [% IF attribute.findvalue("@isDerivedUnion") == "true" %]true[% ELSE %]false[% END %]; - QModelingObject::propertyDataHash[QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::DocumentationRole] = QStringLiteral("${attribute.findvalue("ownedComment/body/text()")}"); - QModelingObject::propertyDataHash[QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::RedefinedPropertiesRole] = QStringLiteral("${attribute.findvalue("@redefinedProperty")}"); - QModelingObject::propertyDataHash[QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("${attribute.findvalue("@subsettedProperty")}"); - QModelingObject::propertyDataHash[QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::OppositeEndRole] = QStringLiteral(" + QModelingObject::propertyDataHash[QStringLiteral("Q${namespace}${className}")][QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::PropertyClassRole] = QStringLiteral("Q${namespace}${className}"); + QModelingObject::propertyDataHash[QStringLiteral("Q${namespace}${className}")][QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::IsDerivedRole] = [% IF attribute.findvalue("@isDerived") == "true" %]true[% ELSE %]false[% END %]; + QModelingObject::propertyDataHash[QStringLiteral("Q${namespace}${className}")][QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::IsDerivedUnionRole] = [% IF attribute.findvalue("@isDerivedUnion") == "true" %]true[% ELSE %]false[% END %]; + QModelingObject::propertyDataHash[QStringLiteral("Q${namespace}${className}")][QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::DocumentationRole] = QStringLiteral("${attribute.findvalue("ownedComment/body/text()")}"); + QModelingObject::propertyDataHash[QStringLiteral("Q${namespace}${className}")][QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::RedefinedPropertiesRole] = QStringLiteral("${attribute.findvalue("@redefinedProperty")}"); + QModelingObject::propertyDataHash[QStringLiteral("Q${namespace}${className}")][QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("${attribute.findvalue("@subsettedProperty")}"); + QModelingObject::propertyDataHash[QStringLiteral("Q${namespace}${className}")][QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::OppositeEndRole] = QStringLiteral(" [%- IF association != "" -%] [%- FOREACH memberEnd = xmi.findvalue("//packagedElement[@xmi:type=\"uml:Association\" and @name=\"${association}\"]/@memberEnd").split(' ') -%] [%- NEXT IF memberEnd == className.replace('$', "-${attribute.findvalue(\"@name\")}") -%] |
