ModelEditor: Refactor relationables into common parent class

Change-Id: Id863a5004cb903cbc2929745e818e5810ff70dd2
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Jochen Becher
2016-06-26 20:39:59 +02:00
parent 8100812531
commit 6ea47c98fb
10 changed files with 71 additions and 103 deletions

View File

@@ -217,23 +217,6 @@ QList<ILatchable::Latch> ComponentItem::verticalLatches(ILatchable::Action actio
return ObjectItem::verticalLatches(action, grabbedItem);
}
QPointF ComponentItem::relationStartPos() const
{
return pos();
}
void ComponentItem::relationDrawn(const QString &id, const QPointF &toScenePos, const QList<QPointF> &intermediatePoints)
{
DElement *targetElement = diagramSceneModel()->findTopmostElement(toScenePos);
if (targetElement) {
if (id == QStringLiteral("dependency")) {
auto dependantObject = dynamic_cast<DObject *>(targetElement);
if (dependantObject)
diagramSceneModel()->diagramSceneController()->createDependency(object(), dependantObject, intermediatePoints, diagramSceneModel()->diagram());
}
}
}
bool ComponentItem::hasPlainShape() const
{
auto diagramComponent = dynamic_cast<DComponent *>(object());