diff options
| author | Sandro S. Andrade <sandroandrade@kde.org> | 2013-10-09 20:19:34 -0300 |
|---|---|---|
| committer | Sandro S. Andrade <sandroandrade@kde.org> | 2013-10-10 01:23:16 +0200 |
| commit | dc76a0dc87fe7ee0f94e96881990a4e83911fd8e (patch) | |
| tree | f5b0731e183ecfe8c8d0a888a966508984d921db /src/uml/qumldatastorenode.cpp | |
| parent | 01ae27fe58be35914b0c4f573782f90242a9bfd9 (diff) | |
Further refactoring in QtModeling (initial step)
Change-Id: Id8ca8a50edefeeb5c71206e96adbc4777eb82ccd
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'src/uml/qumldatastorenode.cpp')
| -rw-r--r-- | src/uml/qumldatastorenode.cpp | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/src/uml/qumldatastorenode.cpp b/src/uml/qumldatastorenode.cpp index b21a3558..ca6b9e20 100644 --- a/src/uml/qumldatastorenode.cpp +++ b/src/uml/qumldatastorenode.cpp @@ -75,7 +75,7 @@ QUmlDataStoreNode::QUmlDataStoreNode(bool createQObject) : { if (createQObject) _qObject = new QUmlDataStoreNodeObject(this); - setClassForProperty(); + setGroupProperties(); setPropertyData(); } @@ -127,34 +127,36 @@ QModelingObject *QUmlDataStoreNode::clone() const return c; } -void QUmlDataStoreNode::setClassForProperty() +void QUmlDataStoreNode::setGroupProperties() { - _classForProperty[QStringLiteral("ownedComments")] = QStringLiteral("QUmlElement"); - _classForProperty[QStringLiteral("ownedElements")] = QStringLiteral("QUmlElement"); - _classForProperty[QStringLiteral("owner")] = QStringLiteral("QUmlElement"); - _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("QUmlNamedElement"); - _classForProperty[QStringLiteral("isLeaf")] = QStringLiteral("QUmlRedefinableElement"); - _classForProperty[QStringLiteral("redefinedElements")] = QStringLiteral("QUmlRedefinableElement"); - _classForProperty[QStringLiteral("redefinitionContexts")] = QStringLiteral("QUmlRedefinableElement"); - _classForProperty[QStringLiteral("activity")] = QStringLiteral("QUmlActivityNode"); - _classForProperty[QStringLiteral("inGroups")] = QStringLiteral("QUmlActivityNode"); - _classForProperty[QStringLiteral("inInterruptibleRegions")] = QStringLiteral("QUmlActivityNode"); - _classForProperty[QStringLiteral("inPartitions")] = QStringLiteral("QUmlActivityNode"); - _classForProperty[QStringLiteral("inStructuredNode")] = QStringLiteral("QUmlActivityNode"); - _classForProperty[QStringLiteral("incomings")] = QStringLiteral("QUmlActivityNode"); - _classForProperty[QStringLiteral("outgoings")] = QStringLiteral("QUmlActivityNode"); - _classForProperty[QStringLiteral("redefinedNodes")] = QStringLiteral("QUmlActivityNode"); - _classForProperty[QStringLiteral("type")] = QStringLiteral("QUmlTypedElement"); - _classForProperty[QStringLiteral("inStates")] = QStringLiteral("QUmlObjectNode"); - _classForProperty[QStringLiteral("isControlType")] = QStringLiteral("QUmlObjectNode"); - _classForProperty[QStringLiteral("ordering")] = QStringLiteral("QUmlObjectNode"); - _classForProperty[QStringLiteral("selection")] = QStringLiteral("QUmlObjectNode"); - _classForProperty[QStringLiteral("upperBound")] = QStringLiteral("QUmlObjectNode"); + 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("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("QUmlNamedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("visibility")))); + _groupProperties.insert(QStringLiteral("QUmlRedefinableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("isLeaf")))); + _groupProperties.insert(QStringLiteral("QUmlRedefinableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("redefinedElements")))); + _groupProperties.insert(QStringLiteral("QUmlRedefinableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("redefinitionContexts")))); + _groupProperties.insert(QStringLiteral("QUmlActivityNode"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("activity")))); + _groupProperties.insert(QStringLiteral("QUmlActivityNode"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("inGroups")))); + _groupProperties.insert(QStringLiteral("QUmlActivityNode"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("inInterruptibleRegions")))); + _groupProperties.insert(QStringLiteral("QUmlActivityNode"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("inPartitions")))); + _groupProperties.insert(QStringLiteral("QUmlActivityNode"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("inStructuredNode")))); + _groupProperties.insert(QStringLiteral("QUmlActivityNode"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("incomings")))); + _groupProperties.insert(QStringLiteral("QUmlActivityNode"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("outgoings")))); + _groupProperties.insert(QStringLiteral("QUmlActivityNode"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("redefinedNodes")))); + _groupProperties.insert(QStringLiteral("QUmlTypedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("type")))); + _groupProperties.insert(QStringLiteral("QUmlObjectNode"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("inStates")))); + _groupProperties.insert(QStringLiteral("QUmlObjectNode"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("isControlType")))); + _groupProperties.insert(QStringLiteral("QUmlObjectNode"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("ordering")))); + _groupProperties.insert(QStringLiteral("QUmlObjectNode"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("selection")))); + _groupProperties.insert(QStringLiteral("QUmlObjectNode"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("upperBound")))); } void QUmlDataStoreNode::setPropertyData() |
