diff options
Diffstat (limited to 'src/uml/qumlinterval.cpp')
-rw-r--r-- | src/uml/qumlinterval.cpp | 68 |
1 files changed, 12 insertions, 56 deletions
diff --git a/src/uml/qumlinterval.cpp b/src/uml/qumlinterval.cpp index 8c94b173..41e8cfd7 100644 --- a/src/uml/qumlinterval.cpp +++ b/src/uml/qumlinterval.cpp @@ -61,26 +61,24 @@ \brief An interval defines the range between two value specifications. */ -QUmlInterval::QUmlInterval(bool createQObject) : +QUmlInterval::QUmlInterval(bool createQModelingObject) : _max(0), _min(0) { - if (createQObject) - _qObject = new QUmlIntervalObject(this); - setGroupProperties(); - setPropertyData(); + if (createQModelingObject) + _qModelingObject = qobject_cast<QModelingObject *>(new QUmlIntervalObject(this)); } QUmlInterval::~QUmlInterval() { - if (!deletingFromQObject) { - if (_qObject) - _qObject->setProperty("deletingFromModelingObject", true); - delete _qObject; + if (!deletingFromQModelingObject) { + if (_qModelingObject) + _qModelingObject->setProperty("deletingFromModelingObject", true); + delete _qModelingObject; } } -QModelingObject *QUmlInterval::clone() const +QModelingElement *QUmlInterval::clone() const { QUmlInterval *c = new QUmlInterval; foreach (QUmlComment *element, ownedComments()) @@ -122,8 +120,8 @@ void QUmlInterval::setMax(QUmlValueSpecification *max) if (_max != max) { _max = max; - if (max && max->asQObject() && this->asQObject()) - QObject::connect(max->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setMax())); + if (max && max->asQModelingObject() && this->asQModelingObject()) + QObject::connect(max->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setMax())); } } @@ -143,50 +141,8 @@ void QUmlInterval::setMin(QUmlValueSpecification *min) if (_min != min) { _min = min; - if (min && min->asQObject() && this->asQObject()) - QObject::connect(min->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setMin())); + if (min && min->asQModelingObject() && this->asQModelingObject()) + QObject::connect(min->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setMin())); } } -void QUmlInterval::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("QUmlTypedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("type")))); - _groupProperties.insert(QStringLiteral("QUmlParameterableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("owningTemplateParameter")))); - _groupProperties.insert(QStringLiteral("QUmlParameterableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("templateParameter")))); - _groupProperties.insert(QStringLiteral("QUmlPackageableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("visibility")))); - _groupProperties.insert(QStringLiteral("QUmlInterval"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("max")))); - _groupProperties.insert(QStringLiteral("QUmlInterval"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("min")))); -} - -void QUmlInterval::setPropertyData() -{ - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("max")][QtModeling::AggregationRole] = QStringLiteral("none"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("max")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlInterval"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("max")][QtModeling::IsDerivedRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("max")][QtModeling::IsDerivedUnionRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("max")][QtModeling::DocumentationRole] = QStringLiteral("Refers to the ValueSpecification denoting the maximum value of the range."); - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("max")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("max")][QtModeling::SubsettedPropertiesRole] = QStringLiteral(""); - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("max")][QtModeling::OppositeEndRole] = QStringLiteral(""); - - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("min")][QtModeling::AggregationRole] = QStringLiteral("none"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("min")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlInterval"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("min")][QtModeling::IsDerivedRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("min")][QtModeling::IsDerivedUnionRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("min")][QtModeling::DocumentationRole] = QStringLiteral("Refers to the ValueSpecification denoting the minimum value of the range."); - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("min")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("min")][QtModeling::SubsettedPropertiesRole] = QStringLiteral(""); - QModelingObject::propertyDataHash[QStringLiteral("QUmlInterval")][QStringLiteral("min")][QtModeling::OppositeEndRole] = QStringLiteral(""); - -} - |