diff options
Diffstat (limited to 'src/uml/qumlcreatelinkaction.cpp')
-rw-r--r-- | src/uml/qumlcreatelinkaction.cpp | 76 |
1 files changed, 13 insertions, 63 deletions
diff --git a/src/uml/qumlcreatelinkaction.cpp b/src/uml/qumlcreatelinkaction.cpp index a23e0507..ad1c2868 100644 --- a/src/uml/qumlcreatelinkaction.cpp +++ b/src/uml/qumlcreatelinkaction.cpp @@ -73,24 +73,22 @@ \brief A create link action is a write link action for creating links. */ -QUmlCreateLinkAction::QUmlCreateLinkAction(bool createQObject) +QUmlCreateLinkAction::QUmlCreateLinkAction(bool createQModelingObject) { - if (createQObject) - _qObject = new QUmlCreateLinkActionObject(this); - setGroupProperties(); - setPropertyData(); + if (createQModelingObject) + _qModelingObject = qobject_cast<QModelingObject *>(new QUmlCreateLinkActionObject(this)); } QUmlCreateLinkAction::~QUmlCreateLinkAction() { - if (!deletingFromQObject) { - if (_qObject) - _qObject->setProperty("deletingFromModelingObject", true); - delete _qObject; + if (!deletingFromQModelingObject) { + if (_qModelingObject) + _qModelingObject->setProperty("deletingFromModelingObject", true); + delete _qModelingObject; } } -QModelingObject *QUmlCreateLinkAction::clone() const +QModelingElement *QUmlCreateLinkAction::clone() const { QUmlCreateLinkAction *c = new QUmlCreateLinkAction; foreach (QUmlComment *element, ownedComments()) @@ -148,9 +146,9 @@ void QUmlCreateLinkAction::addEndData(QUmlLinkEndCreationData *endData) if (!_endData.contains(endData)) { _endData.insert(endData); - if (endData && endData->asQObject() && this->asQObject()) - QObject::connect(endData->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeEndData(QObject *))); - endData->asQObject()->setParent(this->asQObject()); + if (endData && endData->asQModelingObject() && this->asQModelingObject()) + QObject::connect(endData->asQModelingObject(), SIGNAL(destroyed(QObject*)), this->asQModelingObject(), SLOT(removeEndData(QObject *))); + endData->asQModelingObject()->setParent(this->asQModelingObject()); } } @@ -160,56 +158,8 @@ void QUmlCreateLinkAction::removeEndData(QUmlLinkEndCreationData *endData) if (_endData.contains(endData)) { _endData.remove(endData); - if (endData->asQObject()) - endData->asQObject()->setParent(0); + if (endData->asQModelingObject()) + endData->asQModelingObject()->setParent(0); } } -void QUmlCreateLinkAction::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("QUmlLinkAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("inputValues")))); - _groupProperties.insert(QStringLiteral("QUmlCreateLinkAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("endData")))); -} - -void QUmlCreateLinkAction::setPropertyData() -{ - QModelingObject::propertyDataHash[QStringLiteral("QUmlCreateLinkAction")][QStringLiteral("endData")][QtModeling::AggregationRole] = QStringLiteral("composite"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlCreateLinkAction")][QStringLiteral("endData")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlCreateLinkAction"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlCreateLinkAction")][QStringLiteral("endData")][QtModeling::IsDerivedRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlCreateLinkAction")][QStringLiteral("endData")][QtModeling::IsDerivedUnionRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlCreateLinkAction")][QStringLiteral("endData")][QtModeling::DocumentationRole] = QStringLiteral("Specifies ends of association and inputs."); - QModelingObject::propertyDataHash[QStringLiteral("QUmlCreateLinkAction")][QStringLiteral("endData")][QtModeling::RedefinedPropertiesRole] = QStringLiteral("LinkAction-endData"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlCreateLinkAction")][QStringLiteral("endData")][QtModeling::SubsettedPropertiesRole] = QStringLiteral(""); - QModelingObject::propertyDataHash[QStringLiteral("QUmlCreateLinkAction")][QStringLiteral("endData")][QtModeling::OppositeEndRole] = QStringLiteral(""); - -} - |