summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlunmarshallaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uml/qumlunmarshallaction.cpp')
-rw-r--r--src/uml/qumlunmarshallaction.cpp105
1 files changed, 18 insertions, 87 deletions
diff --git a/src/uml/qumlunmarshallaction.cpp b/src/uml/qumlunmarshallaction.cpp
index ebf47c3c..fbb069c5 100644
--- a/src/uml/qumlunmarshallaction.cpp
+++ b/src/uml/qumlunmarshallaction.cpp
@@ -70,26 +70,24 @@
\brief An unmarshall action is an action that breaks an object of a known type into outputs each of which is equal to a value from a structural feature of the object.
*/
-QUmlUnmarshallAction::QUmlUnmarshallAction(bool createQObject) :
+QUmlUnmarshallAction::QUmlUnmarshallAction(bool createQModelingObject) :
_object(0),
_unmarshallType(0)
{
- if (createQObject)
- _qObject = new QUmlUnmarshallActionObject(this);
- setGroupProperties();
- setPropertyData();
+ if (createQModelingObject)
+ _qModelingObject = qobject_cast<QModelingObject *>(new QUmlUnmarshallActionObject(this));
}
QUmlUnmarshallAction::~QUmlUnmarshallAction()
{
- if (!deletingFromQObject) {
- if (_qObject)
- _qObject->setProperty("deletingFromModelingObject", true);
- delete _qObject;
+ if (!deletingFromQModelingObject) {
+ if (_qModelingObject)
+ _qModelingObject->setProperty("deletingFromModelingObject", true);
+ delete _qModelingObject;
}
}
-QModelingObject *QUmlUnmarshallAction::clone() const
+QModelingElement *QUmlUnmarshallAction::clone() const
{
QUmlUnmarshallAction *c = new QUmlUnmarshallAction;
foreach (QUmlComment *element, ownedComments())
@@ -152,9 +150,9 @@ void QUmlUnmarshallAction::setObject(QUmlInputPin *object)
removeInput(_object);
_object = object;
- if (object && object->asQObject() && this->asQObject())
- QObject::connect(object->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setObject()));
- object->asQObject()->setParent(this->asQObject());
+ if (object && object->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(object->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setObject()));
+ object->asQModelingObject()->setParent(this->asQModelingObject());
// Adjust subsetted properties
if (object) {
@@ -179,9 +177,9 @@ void QUmlUnmarshallAction::addResult(QUmlOutputPin *result)
if (!_results.contains(result)) {
_results.insert(result);
- if (result && result->asQObject() && this->asQObject())
- QObject::connect(result->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeResult(QObject *)));
- result->asQObject()->setParent(this->asQObject());
+ if (result && result->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(result->asQModelingObject(), SIGNAL(destroyed(QObject*)), this->asQModelingObject(), SLOT(removeResult(QObject *)));
+ result->asQModelingObject()->setParent(this->asQModelingObject());
// Adjust subsetted properties
addOutput(result);
@@ -194,8 +192,8 @@ void QUmlUnmarshallAction::removeResult(QUmlOutputPin *result)
if (_results.contains(result)) {
_results.remove(result);
- if (result->asQObject())
- result->asQObject()->setParent(0);
+ if (result->asQModelingObject())
+ result->asQModelingObject()->setParent(0);
// Adjust subsetted properties
removeOutput(result);
@@ -218,75 +216,8 @@ void QUmlUnmarshallAction::setUnmarshallType(QUmlClassifier *unmarshallType)
if (_unmarshallType != unmarshallType) {
_unmarshallType = unmarshallType;
- if (unmarshallType && unmarshallType->asQObject() && this->asQObject())
- QObject::connect(unmarshallType->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setUnmarshallType()));
+ if (unmarshallType && unmarshallType->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(unmarshallType->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setUnmarshallType()));
}
}
-void QUmlUnmarshallAction::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("QUmlUnmarshallAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("object"))));
- _groupProperties.insert(QStringLiteral("QUmlUnmarshallAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("results"))));
- _groupProperties.insert(QStringLiteral("QUmlUnmarshallAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("unmarshallType"))));
-}
-
-void QUmlUnmarshallAction::setPropertyData()
-{
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("object")][QtModeling::AggregationRole] = QStringLiteral("composite");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("object")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlUnmarshallAction");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("object")][QtModeling::IsDerivedRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("object")][QtModeling::IsDerivedUnionRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("object")][QtModeling::DocumentationRole] = QStringLiteral("The object to be unmarshalled.");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("object")][QtModeling::RedefinedPropertiesRole] = QStringLiteral("");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("object")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("Action-input");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("object")][QtModeling::OppositeEndRole] = QStringLiteral("");
-
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("results")][QtModeling::AggregationRole] = QStringLiteral("composite");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("results")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlUnmarshallAction");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("results")][QtModeling::IsDerivedRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("results")][QtModeling::IsDerivedUnionRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("results")][QtModeling::DocumentationRole] = QStringLiteral("The values of the structural features of the input object.");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("results")][QtModeling::RedefinedPropertiesRole] = QStringLiteral("");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("results")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("Action-output");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("results")][QtModeling::OppositeEndRole] = QStringLiteral("");
-
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("unmarshallType")][QtModeling::AggregationRole] = QStringLiteral("none");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("unmarshallType")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlUnmarshallAction");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("unmarshallType")][QtModeling::IsDerivedRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("unmarshallType")][QtModeling::IsDerivedUnionRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("unmarshallType")][QtModeling::DocumentationRole] = QStringLiteral("The type of the object to be unmarshalled.");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("unmarshallType")][QtModeling::RedefinedPropertiesRole] = QStringLiteral("");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("unmarshallType")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlUnmarshallAction")][QStringLiteral("unmarshallType")][QtModeling::OppositeEndRole] = QStringLiteral("");
-
-}
-