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/qumlstringexpression.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/qumlstringexpression.cpp')
| -rw-r--r-- | src/uml/qumlstringexpression.cpp | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/src/uml/qumlstringexpression.cpp b/src/uml/qumlstringexpression.cpp index ee3d0e2a..40a6d8dd 100644 --- a/src/uml/qumlstringexpression.cpp +++ b/src/uml/qumlstringexpression.cpp @@ -68,7 +68,7 @@ QUmlStringExpression::QUmlStringExpression(bool createQObject) : { if (createQObject) _qObject = new QUmlStringExpressionObject(this); - setClassForProperty(); + setGroupProperties(); setPropertyData(); } @@ -191,26 +191,28 @@ QString QUmlStringExpression::stringValue() const return QString (); } -void QUmlStringExpression::setClassForProperty() +void QUmlStringExpression::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("type")] = QStringLiteral("QUmlTypedElement"); - _classForProperty[QStringLiteral("owningTemplateParameter")] = QStringLiteral("QUmlParameterableElement"); - _classForProperty[QStringLiteral("templateParameter")] = QStringLiteral("QUmlParameterableElement"); - _classForProperty[QStringLiteral("visibility")] = QStringLiteral("QUmlPackageableElement"); - _classForProperty[QStringLiteral("operands")] = QStringLiteral("QUmlExpression"); - _classForProperty[QStringLiteral("symbol")] = QStringLiteral("QUmlExpression"); - _classForProperty[QStringLiteral("ownedTemplateSignature")] = QStringLiteral("QUmlTemplateableElement"); - _classForProperty[QStringLiteral("templateBindings")] = QStringLiteral("QUmlTemplateableElement"); - _classForProperty[QStringLiteral("owningExpression")] = QStringLiteral("QUmlStringExpression"); - _classForProperty[QStringLiteral("subExpressions")] = QStringLiteral("QUmlStringExpression"); + 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("QUmlTypedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("type")))); + _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("QUmlPackageableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("visibility")))); + _groupProperties.insert(QStringLiteral("QUmlExpression"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("operands")))); + _groupProperties.insert(QStringLiteral("QUmlExpression"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("symbol")))); + _groupProperties.insert(QStringLiteral("QUmlTemplateableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("ownedTemplateSignature")))); + _groupProperties.insert(QStringLiteral("QUmlTemplateableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("templateBindings")))); + _groupProperties.insert(QStringLiteral("QUmlStringExpression"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("owningExpression")))); + _groupProperties.insert(QStringLiteral("QUmlStringExpression"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("subExpressions")))); } void QUmlStringExpression::setPropertyData() |
