diff options
Diffstat (limited to 'src/uml/qumlreadvariableaction.cpp')
-rw-r--r-- | src/uml/qumlreadvariableaction.cpp | 72 |
1 files changed, 11 insertions, 61 deletions
diff --git a/src/uml/qumlreadvariableaction.cpp b/src/uml/qumlreadvariableaction.cpp index ea5dd2a0..9fad67a0 100644 --- a/src/uml/qumlreadvariableaction.cpp +++ b/src/uml/qumlreadvariableaction.cpp @@ -71,25 +71,23 @@ \brief A read variable action is a variable action that retrieves the values of a variable. */ -QUmlReadVariableAction::QUmlReadVariableAction(bool createQObject) : +QUmlReadVariableAction::QUmlReadVariableAction(bool createQModelingObject) : _result(0) { - if (createQObject) - _qObject = new QUmlReadVariableActionObject(this); - setGroupProperties(); - setPropertyData(); + if (createQModelingObject) + _qModelingObject = qobject_cast<QModelingObject *>(new QUmlReadVariableActionObject(this)); } QUmlReadVariableAction::~QUmlReadVariableAction() { - if (!deletingFromQObject) { - if (_qObject) - _qObject->setProperty("deletingFromModelingObject", true); - delete _qObject; + if (!deletingFromQModelingObject) { + if (_qModelingObject) + _qModelingObject->setProperty("deletingFromModelingObject", true); + delete _qModelingObject; } } -QModelingObject *QUmlReadVariableAction::clone() const +QModelingElement *QUmlReadVariableAction::clone() const { QUmlReadVariableAction *c = new QUmlReadVariableAction; foreach (QUmlComment *element, ownedComments()) @@ -150,9 +148,9 @@ void QUmlReadVariableAction::setResult(QUmlOutputPin *result) removeOutput(_result); _result = result; - if (result && result->asQObject() && this->asQObject()) - QObject::connect(result->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setResult())); - result->asQObject()->setParent(this->asQObject()); + if (result && result->asQModelingObject() && this->asQModelingObject()) + QObject::connect(result->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setResult())); + result->asQModelingObject()->setParent(this->asQModelingObject()); // Adjust subsetted properties if (result) { @@ -161,51 +159,3 @@ void QUmlReadVariableAction::setResult(QUmlOutputPin *result) } } -void QUmlReadVariableAction::setGroupProperties() -{ - 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("QUmlExecutableNode"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("handlers")))); - _groupProperties.insert(QStringLiteral("QUmlAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("context")))); - _groupProperties.insert(QStringLiteral("QUmlAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("inputs")))); - _groupProperties.insert(QStringLiteral("QUmlAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("isLocallyReentrant")))); - _groupProperties.insert(QStringLiteral("QUmlAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("localPostconditions")))); - _groupProperties.insert(QStringLiteral("QUmlAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("localPreconditions")))); - _groupProperties.insert(QStringLiteral("QUmlAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("outputs")))); - _groupProperties.insert(QStringLiteral("QUmlVariableAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("variable")))); - _groupProperties.insert(QStringLiteral("QUmlReadVariableAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("result")))); -} - -void QUmlReadVariableAction::setPropertyData() -{ - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadVariableAction")][QStringLiteral("result")][QtModeling::AggregationRole] = QStringLiteral("composite"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadVariableAction")][QStringLiteral("result")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlReadVariableAction"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadVariableAction")][QStringLiteral("result")][QtModeling::IsDerivedRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadVariableAction")][QStringLiteral("result")][QtModeling::IsDerivedUnionRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadVariableAction")][QStringLiteral("result")][QtModeling::DocumentationRole] = QStringLiteral("Gives the output pin on which the result is put."); - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadVariableAction")][QStringLiteral("result")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadVariableAction")][QStringLiteral("result")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("Action-output"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadVariableAction")][QStringLiteral("result")][QtModeling::OppositeEndRole] = QStringLiteral(""); - -} - |