From 3b49b6a0d4c4d2ee94faeff207da10c452f70b07 Mon Sep 17 00:00:00 2001 From: Lukáš Lalinský Date: Thu, 11 Dec 2008 12:34:38 +0100 Subject: Support for generic diagram item properties editors + add relationship props editor UI --- src/diagramdocument.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/diagramdocument.cpp') diff --git a/src/diagramdocument.cpp b/src/diagramdocument.cpp index 1f34d9f..9df8b75 100644 --- a/src/diagramdocument.cpp +++ b/src/diagramdocument.cpp @@ -138,6 +138,19 @@ DiagramDocument::itemsByType() return result; } +QList +DiagramDocument::selectedItems() +{ + QList result; + foreach(QGraphicsItem *item, QGraphicsScene::selectedItems()) { + DiagramItem *typedItem = dynamic_cast(item); + if (typedItem) { + result.append(typedItem); + } + } + return result; +} + void DiagramDocument::itemMoved(DiagramItem *item) { @@ -230,7 +243,7 @@ DiagramDocument::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) DatabaseTable * DiagramDocument::selectedTable() { - QList items = selectedItems(); + QList items = selectedItems(); if (items.size() != 1) return NULL; return qgraphicsitem_cast(items[0]); -- cgit v1.2.3-54-g00ecf