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/qumlprotocoltransition.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/qumlprotocoltransition.cpp')
-rw-r--r-- | src/uml/qumlprotocoltransition.cpp | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/src/uml/qumlprotocoltransition.cpp b/src/uml/qumlprotocoltransition.cpp index 367625f8..f676cf56 100644 --- a/src/uml/qumlprotocoltransition.cpp +++ b/src/uml/qumlprotocoltransition.cpp @@ -77,7 +77,7 @@ QUmlProtocolTransition::QUmlProtocolTransition(bool createQObject) : { if (createQObject) _qObject = new QUmlProtocolTransitionObject(this); - setClassForProperty(); + setGroupProperties(); setPropertyData(); } @@ -225,37 +225,39 @@ void QUmlProtocolTransition::removeReferred(QUmlOperation *referred) } } -void QUmlProtocolTransition::setClassForProperty() +void QUmlProtocolTransition::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("elementImports")] = QStringLiteral("QUmlNamespace"); - _classForProperty[QStringLiteral("importedMembers")] = QStringLiteral("QUmlNamespace"); - _classForProperty[QStringLiteral("members")] = QStringLiteral("QUmlNamespace"); - _classForProperty[QStringLiteral("ownedMembers")] = QStringLiteral("QUmlNamespace"); - _classForProperty[QStringLiteral("ownedRules")] = QStringLiteral("QUmlNamespace"); - _classForProperty[QStringLiteral("packageImports")] = QStringLiteral("QUmlNamespace"); - _classForProperty[QStringLiteral("container")] = QStringLiteral("QUmlTransition"); - _classForProperty[QStringLiteral("effect")] = QStringLiteral("QUmlTransition"); - _classForProperty[QStringLiteral("guard")] = QStringLiteral("QUmlTransition"); - _classForProperty[QStringLiteral("kind")] = QStringLiteral("QUmlTransition"); - _classForProperty[QStringLiteral("redefinedTransition")] = QStringLiteral("QUmlTransition"); - _classForProperty[QStringLiteral("redefinitionContext")] = QStringLiteral("QUmlTransition"); - _classForProperty[QStringLiteral("source")] = QStringLiteral("QUmlTransition"); - _classForProperty[QStringLiteral("target")] = QStringLiteral("QUmlTransition"); - _classForProperty[QStringLiteral("triggers")] = QStringLiteral("QUmlTransition"); - _classForProperty[QStringLiteral("postCondition")] = QStringLiteral("QUmlProtocolTransition"); - _classForProperty[QStringLiteral("preCondition")] = QStringLiteral("QUmlProtocolTransition"); - _classForProperty[QStringLiteral("referred")] = QStringLiteral("QUmlProtocolTransition"); + 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("QUmlNamespace"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("elementImports")))); + _groupProperties.insert(QStringLiteral("QUmlNamespace"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("importedMembers")))); + _groupProperties.insert(QStringLiteral("QUmlNamespace"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("members")))); + _groupProperties.insert(QStringLiteral("QUmlNamespace"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("ownedMembers")))); + _groupProperties.insert(QStringLiteral("QUmlNamespace"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("ownedRules")))); + _groupProperties.insert(QStringLiteral("QUmlNamespace"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("packageImports")))); + _groupProperties.insert(QStringLiteral("QUmlTransition"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("container")))); + _groupProperties.insert(QStringLiteral("QUmlTransition"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("effect")))); + _groupProperties.insert(QStringLiteral("QUmlTransition"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("guard")))); + _groupProperties.insert(QStringLiteral("QUmlTransition"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("kind")))); + _groupProperties.insert(QStringLiteral("QUmlTransition"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("redefinedTransition")))); + _groupProperties.insert(QStringLiteral("QUmlTransition"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("redefinitionContext")))); + _groupProperties.insert(QStringLiteral("QUmlTransition"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("source")))); + _groupProperties.insert(QStringLiteral("QUmlTransition"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("target")))); + _groupProperties.insert(QStringLiteral("QUmlTransition"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("triggers")))); + _groupProperties.insert(QStringLiteral("QUmlProtocolTransition"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("postCondition")))); + _groupProperties.insert(QStringLiteral("QUmlProtocolTransition"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("preCondition")))); + _groupProperties.insert(QStringLiteral("QUmlProtocolTransition"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("referred")))); } void QUmlProtocolTransition::setPropertyData() |