diff options
Diffstat (limited to 'examples/uml')
-rw-r--r-- | examples/uml/duse-mt/src/app/example.xmi | 2 | ||||
-rw-r--r-- | examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/relationshipitem.cpp | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/examples/uml/duse-mt/src/app/example.xmi b/examples/uml/duse-mt/src/app/example.xmi index e733ab01..26f0e517 100644 --- a/examples/uml/duse-mt/src/app/example.xmi +++ b/examples/uml/duse-mt/src/app/example.xmi @@ -23,7 +23,7 @@ <ownedAttribute xmi:type="uml:Property" visibility="public" name="age" xmi:id="MyRootPackage-Package1-Student-age"> <type href=":/metamodels/PrimitiveTypes.xmi#Integer"/> </ownedAttribute> - <ownedAttribute xmi:type="uml:Property" visibility="public" name="advisor" xmi:id="MyRootPackage-Package1-Student-advisor"> + <ownedAttribute xmi:type="uml:Property" visibility="public" name="advisor" xmi:id="MyRootPackage-Package1-Student-advisor" aggregation="composite"> <type href="MyRootPackage-Package1-Professor"/> </ownedAttribute> <ownedOperation xmi:type="uml:Operation" name="getName" xmi:id="MyRootPackage-Package1-Student-getName"/> diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/relationshipitem.cpp b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/relationshipitem.cpp index 807ad3f4..b1790525 100644 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/relationshipitem.cpp +++ b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/relationshipitem.cpp @@ -74,11 +74,20 @@ void RelationshipItem::paint(QPainter *painter) if (originalLine.intersect(QLineF(x2 + w2, y2 , x2 + w2, y2 + h2), &p2) == QLineF::BoundedIntersection) {} painter->drawLine(p1.x()-x(), p1.y()-y(), p2.x()-x(), p2.y()-y()); + QPolygonF arrow(QVector<QPointF>() << QPointF(-10, -10) << QPointF(0, 0) << QPointF(-10, +10)); QTransform transform; transform.translate(p2.x()-x(), p2.y()-y()); transform.rotate(-originalLine.angle()); - QPolygonF arrow(QVector<QPointF>() << QPointF(-10, -10) << QPointF(0, 0) << QPointF(-10, +10)); painter->drawPolyline(transform.map(arrow)); + + if (_end1Aggregation == "composite") { + painter->setBrush(QBrush(Qt::black)); + QPolygon diamond(QVector<QPoint>() << QPoint(0, 0) << QPoint(10, -10) << QPoint(20, 0) << QPoint(10, 10)); + QTransform transform; + transform.translate(p1.x()-x(), p1.y()-y()); + transform.rotate(-originalLine.angle()); + painter->drawPolygon(transform.map(diamond)); + } } QQuickRectangle *RelationshipItem::end1() const |