diff options
Diffstat (limited to 'src/uml/qumlreadextentaction.cpp')
-rw-r--r-- | src/uml/qumlreadextentaction.cpp | 85 |
1 files changed, 13 insertions, 72 deletions
diff --git a/src/uml/qumlreadextentaction.cpp b/src/uml/qumlreadextentaction.cpp index 8f03dc1e..097cc2e8 100644 --- a/src/uml/qumlreadextentaction.cpp +++ b/src/uml/qumlreadextentaction.cpp @@ -70,26 +70,24 @@ \brief A read extent action is an action that retrieves the current instances of a classifier. */ -QUmlReadExtentAction::QUmlReadExtentAction(bool createQObject) : +QUmlReadExtentAction::QUmlReadExtentAction(bool createQModelingObject) : _classifier(0), _result(0) { - if (createQObject) - _qObject = new QUmlReadExtentActionObject(this); - setGroupProperties(); - setPropertyData(); + if (createQModelingObject) + _qModelingObject = qobject_cast<QModelingObject *>(new QUmlReadExtentActionObject(this)); } QUmlReadExtentAction::~QUmlReadExtentAction() { - if (!deletingFromQObject) { - if (_qObject) - _qObject->setProperty("deletingFromModelingObject", true); - delete _qObject; + if (!deletingFromQModelingObject) { + if (_qModelingObject) + _qModelingObject->setProperty("deletingFromModelingObject", true); + delete _qModelingObject; } } -QModelingObject *QUmlReadExtentAction::clone() const +QModelingElement *QUmlReadExtentAction::clone() const { QUmlReadExtentAction *c = new QUmlReadExtentAction; foreach (QUmlComment *element, ownedComments()) @@ -147,8 +145,8 @@ void QUmlReadExtentAction::setClassifier(QUmlClassifier *classifier) if (_classifier != classifier) { _classifier = classifier; - if (classifier && classifier->asQObject() && this->asQObject()) - QObject::connect(classifier->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setClassifier())); + if (classifier && classifier->asQModelingObject() && this->asQModelingObject()) + QObject::connect(classifier->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setClassifier())); } } @@ -171,9 +169,9 @@ void QUmlReadExtentAction::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) { @@ -182,60 +180,3 @@ void QUmlReadExtentAction::setResult(QUmlOutputPin *result) } } -void QUmlReadExtentAction::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("QUmlReadExtentAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("classifier")))); - _groupProperties.insert(QStringLiteral("QUmlReadExtentAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("result")))); -} - -void QUmlReadExtentAction::setPropertyData() -{ - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("classifier")][QtModeling::AggregationRole] = QStringLiteral("none"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("classifier")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlReadExtentAction"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("classifier")][QtModeling::IsDerivedRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("classifier")][QtModeling::IsDerivedUnionRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("classifier")][QtModeling::DocumentationRole] = QStringLiteral("The classifier whose instances are to be retrieved."); - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("classifier")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("classifier")][QtModeling::SubsettedPropertiesRole] = QStringLiteral(""); - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("classifier")][QtModeling::OppositeEndRole] = QStringLiteral(""); - - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("result")][QtModeling::AggregationRole] = QStringLiteral("composite"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("result")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlReadExtentAction"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("result")][QtModeling::IsDerivedRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("result")][QtModeling::IsDerivedUnionRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("result")][QtModeling::DocumentationRole] = QStringLiteral("The runtime instances of the classifier."); - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("result")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("result")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("Action-output"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlReadExtentAction")][QStringLiteral("result")][QtModeling::OppositeEndRole] = QStringLiteral(""); - -} - |