summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlvaluespecificationaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uml/qumlvaluespecificationaction.cpp')
-rw-r--r--src/uml/qumlvaluespecificationaction.cpp87
1 files changed, 14 insertions, 73 deletions
diff --git a/src/uml/qumlvaluespecificationaction.cpp b/src/uml/qumlvaluespecificationaction.cpp
index a33c6fe1..91fc3d6c 100644
--- a/src/uml/qumlvaluespecificationaction.cpp
+++ b/src/uml/qumlvaluespecificationaction.cpp
@@ -71,26 +71,24 @@
\brief A value specification action is an action that evaluates a value specification.
*/
-QUmlValueSpecificationAction::QUmlValueSpecificationAction(bool createQObject) :
+QUmlValueSpecificationAction::QUmlValueSpecificationAction(bool createQModelingObject) :
_result(0),
_value(0)
{
- if (createQObject)
- _qObject = new QUmlValueSpecificationActionObject(this);
- setGroupProperties();
- setPropertyData();
+ if (createQModelingObject)
+ _qModelingObject = qobject_cast<QModelingObject *>(new QUmlValueSpecificationActionObject(this));
}
QUmlValueSpecificationAction::~QUmlValueSpecificationAction()
{
- if (!deletingFromQObject) {
- if (_qObject)
- _qObject->setProperty("deletingFromModelingObject", true);
- delete _qObject;
+ if (!deletingFromQModelingObject) {
+ if (_qModelingObject)
+ _qModelingObject->setProperty("deletingFromModelingObject", true);
+ delete _qModelingObject;
}
}
-QModelingObject *QUmlValueSpecificationAction::clone() const
+QModelingElement *QUmlValueSpecificationAction::clone() const
{
QUmlValueSpecificationAction *c = new QUmlValueSpecificationAction;
foreach (QUmlComment *element, ownedComments())
@@ -151,9 +149,9 @@ void QUmlValueSpecificationAction::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) {
@@ -181,9 +179,9 @@ void QUmlValueSpecificationAction::setValue(QUmlValueSpecification *value)
removeOwnedElement(_value);
_value = value;
- if (value && value->asQObject() && this->asQObject())
- QObject::connect(value->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setValue()));
- value->asQObject()->setParent(this->asQObject());
+ if (value && value->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(value->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setValue()));
+ value->asQModelingObject()->setParent(this->asQModelingObject());
// Adjust subsetted properties
if (value) {
@@ -192,60 +190,3 @@ void QUmlValueSpecificationAction::setValue(QUmlValueSpecification *value)
}
}
-void QUmlValueSpecificationAction::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("QUmlValueSpecificationAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("result"))));
- _groupProperties.insert(QStringLiteral("QUmlValueSpecificationAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("value"))));
-}
-
-void QUmlValueSpecificationAction::setPropertyData()
-{
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("result")][QtModeling::AggregationRole] = QStringLiteral("composite");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("result")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlValueSpecificationAction");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("result")][QtModeling::IsDerivedRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("result")][QtModeling::IsDerivedUnionRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("result")][QtModeling::DocumentationRole] = QStringLiteral("Gives the output pin on which the result is put.");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("result")][QtModeling::RedefinedPropertiesRole] = QStringLiteral("");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("result")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("Action-output");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("result")][QtModeling::OppositeEndRole] = QStringLiteral("");
-
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("value")][QtModeling::AggregationRole] = QStringLiteral("composite");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("value")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlValueSpecificationAction");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("value")][QtModeling::IsDerivedRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("value")][QtModeling::IsDerivedUnionRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("value")][QtModeling::DocumentationRole] = QStringLiteral("Value specification to be evaluated.");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("value")][QtModeling::RedefinedPropertiesRole] = QStringLiteral("");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("value")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("Element-ownedElement");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlValueSpecificationAction")][QStringLiteral("value")][QtModeling::OppositeEndRole] = QStringLiteral("");
-
-}
-