summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlusage.cpp
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 /src/uml/qumlusage.cpp
parent01ae27fe58be35914b0c4f573782f90242a9bfd9 (diff)
Further refactoring in QtModeling (initial step)
Change-Id: Id8ca8a50edefeeb5c71206e96adbc4777eb82ccd Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'src/uml/qumlusage.cpp')
-rw-r--r--src/uml/qumlusage.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/uml/qumlusage.cpp b/src/uml/qumlusage.cpp
index 982b5db3..d93891a0 100644
--- a/src/uml/qumlusage.cpp
+++ b/src/uml/qumlusage.cpp
@@ -64,7 +64,7 @@ QUmlUsage::QUmlUsage(bool createQObject) :
{
if (createQObject)
_qObject = new QUmlUsageObject(this);
- setClassForProperty();
+ setGroupProperties();
setPropertyData();
}
@@ -99,24 +99,26 @@ QModelingObject *QUmlUsage::clone() const
return c;
}
-void QUmlUsage::setClassForProperty()
+void QUmlUsage::setGroupProperties()
{
- _classForProperty[QStringLiteral("ownedComments")] = QStringLiteral("QUmlElement");
- _classForProperty[QStringLiteral("ownedElements")] = QStringLiteral("QUmlElement");
- _classForProperty[QStringLiteral("owner")] = QStringLiteral("QUmlElement");
- _classForProperty[QStringLiteral("owningTemplateParameter")] = QStringLiteral("QUmlParameterableElement");
- _classForProperty[QStringLiteral("templateParameter")] = QStringLiteral("QUmlParameterableElement");
- _classForProperty[QStringLiteral("clientDependencies")] = QStringLiteral("QUmlNamedElement");
- _classForProperty[QStringLiteral("name")] = QStringLiteral("QUmlNamedElement");
- _classForProperty[QStringLiteral("nameExpression")] = QStringLiteral("QUmlNamedElement");
- _classForProperty[QStringLiteral("namespace_")] = QStringLiteral("QUmlNamedElement");
- _classForProperty[QStringLiteral("qualifiedName")] = QStringLiteral("QUmlNamedElement");
- _classForProperty[QStringLiteral("visibility")] = QStringLiteral("QUmlPackageableElement");
- _classForProperty[QStringLiteral("relatedElements")] = QStringLiteral("QUmlRelationship");
- _classForProperty[QStringLiteral("sources")] = QStringLiteral("QUmlDirectedRelationship");
- _classForProperty[QStringLiteral("targets")] = QStringLiteral("QUmlDirectedRelationship");
- _classForProperty[QStringLiteral("clients")] = QStringLiteral("QUmlDependency");
- _classForProperty[QStringLiteral("suppliers")] = QStringLiteral("QUmlDependency");
+ const QMetaObject *metaObject = _qObject->metaObject();
+
+ _groupProperties.insert(QStringLiteral("QUmlElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("ownedComments"))));
+ _groupProperties.insert(QStringLiteral("QUmlElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("ownedElements"))));
+ _groupProperties.insert(QStringLiteral("QUmlElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("owner"))));
+ _groupProperties.insert(QStringLiteral("QUmlParameterableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("owningTemplateParameter"))));
+ _groupProperties.insert(QStringLiteral("QUmlParameterableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("templateParameter"))));
+ _groupProperties.insert(QStringLiteral("QUmlNamedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("clientDependencies"))));
+ _groupProperties.insert(QStringLiteral("QUmlNamedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("name"))));
+ _groupProperties.insert(QStringLiteral("QUmlNamedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("nameExpression"))));
+ _groupProperties.insert(QStringLiteral("QUmlNamedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("namespace_"))));
+ _groupProperties.insert(QStringLiteral("QUmlNamedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("qualifiedName"))));
+ _groupProperties.insert(QStringLiteral("QUmlPackageableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("visibility"))));
+ _groupProperties.insert(QStringLiteral("QUmlRelationship"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("relatedElements"))));
+ _groupProperties.insert(QStringLiteral("QUmlDirectedRelationship"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("sources"))));
+ _groupProperties.insert(QStringLiteral("QUmlDirectedRelationship"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("targets"))));
+ _groupProperties.insert(QStringLiteral("QUmlDependency"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("clients"))));
+ _groupProperties.insert(QStringLiteral("QUmlDependency"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("suppliers"))));
}
void QUmlUsage::setPropertyData()