summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlwritevariableaction.cpp
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2013-10-10 17:08:35 -0300
committerSandro S. Andrade <sandroandrade@kde.org>2013-10-10 22:08:50 +0200
commit8c4add8a61b9eeda682f84cca7f99a3f0181726d (patch)
tree6dbff0f3bb03da451147aac6268799b757c51d66 /src/uml/qumlwritevariableaction.cpp
parentdc76a0dc87fe7ee0f94e96881990a4e83911fd8e (diff)
Further refactoring in QtModeling (step 2)
Change-Id: I336f9f24af1c763883e9cc3c716c02ef557bebd1 Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'src/uml/qumlwritevariableaction.cpp')
-rw-r--r--src/uml/qumlwritevariableaction.cpp58
1 files changed, 4 insertions, 54 deletions
diff --git a/src/uml/qumlwritevariableaction.cpp b/src/uml/qumlwritevariableaction.cpp
index 9d1a5324..05adb1b6 100644
--- a/src/uml/qumlwritevariableaction.cpp
+++ b/src/uml/qumlwritevariableaction.cpp
@@ -72,15 +72,13 @@
QUmlWriteVariableAction::QUmlWriteVariableAction() :
_value(0)
{
- setGroupProperties();
- setPropertyData();
}
QUmlWriteVariableAction::~QUmlWriteVariableAction()
{
}
-QModelingObject *QUmlWriteVariableAction::clone() const
+QModelingElement *QUmlWriteVariableAction::clone() const
{
QUmlWriteVariableAction *c = new QUmlWriteVariableAction;
foreach (QUmlComment *element, ownedComments())
@@ -141,9 +139,9 @@ void QUmlWriteVariableAction::setValue(QUmlInputPin *value)
removeInput(_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) {
@@ -152,51 +150,3 @@ void QUmlWriteVariableAction::setValue(QUmlInputPin *value)
}
}
-void QUmlWriteVariableAction::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("QUmlWriteVariableAction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("value"))));
-}
-
-void QUmlWriteVariableAction::setPropertyData()
-{
- QModelingObject::propertyDataHash[QStringLiteral("QUmlWriteVariableAction")][QStringLiteral("value")][QtModeling::AggregationRole] = QStringLiteral("composite");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlWriteVariableAction")][QStringLiteral("value")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlWriteVariableAction");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlWriteVariableAction")][QStringLiteral("value")][QtModeling::IsDerivedRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlWriteVariableAction")][QStringLiteral("value")][QtModeling::IsDerivedUnionRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlWriteVariableAction")][QStringLiteral("value")][QtModeling::DocumentationRole] = QStringLiteral("Value to be added or removed from the variable.");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlWriteVariableAction")][QStringLiteral("value")][QtModeling::RedefinedPropertiesRole] = QStringLiteral("");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlWriteVariableAction")][QStringLiteral("value")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("Action-input");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlWriteVariableAction")][QStringLiteral("value")][QtModeling::OppositeEndRole] = QStringLiteral("");
-
-}
-