diff options
author | Lukáš Lalinský <lalinsky@gmail.com> | 2008-12-12 16:01:05 +0100 |
---|---|---|
committer | Lukáš Lalinský <lalinsky@gmail.com> | 2008-12-12 16:01:05 +0100 |
commit | 94d6d634c08870614cc1ce22e0f635aa8f3ab881 (patch) | |
tree | 481f6ba9d1d6f99fa20e3fe95ff46212940688e0 /src/items/database | |
parent | 1772e08823194ee25b3ebf444ef05290b6b33c68 (diff) | |
download | dbmodel-94d6d634c08870614cc1ce22e0f635aa8f3ab881.tar.xz |
Make diagram notation configurable
Diffstat (limited to 'src/items/database')
-rw-r--r-- | src/items/database/databaserelationship.cpp | 22 | ||||
-rw-r--r-- | src/items/database/databaserelationship.h | 2 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/items/database/databaserelationship.cpp b/src/items/database/databaserelationship.cpp index d908409..6efe07b 100644 --- a/src/items/database/databaserelationship.cpp +++ b/src/items/database/databaserelationship.cpp @@ -329,17 +329,17 @@ DatabaseRelationship::updateLayout() Q_ASSERT(haveLine); - // "Relational" - if (1) { - d->fillEnds = true; - d->targetEnd = d->arrowHeadPath(); - d->sourceEnd = QPainterPath(); - } - // "Crow's Foot" - else { - d->fillEnds = false; - d->targetEnd = d->crowsFootPath(d->cardinality); - d->sourceEnd = d->crowsFootPath(isRequired() ? One : ZeroOrOne); + switch (document()->notation()) { + case DiagramDocument::Relational: + d->fillEnds = true; + d->targetEnd = d->arrowHeadPath(); + d->sourceEnd = QPainterPath(); + break; + case DiagramDocument::CrowsFoot: + d->fillEnds = false; + d->targetEnd = d->crowsFootPath(d->cardinality); + d->sourceEnd = d->crowsFootPath(isRequired() ? One : ZeroOrOne); + break; } if (!d->sourceEnd.isEmpty()) { diff --git a/src/items/database/databaserelationship.h b/src/items/database/databaserelationship.h index d8762cf..9b5f0af 100644 --- a/src/items/database/databaserelationship.h +++ b/src/items/database/databaserelationship.h @@ -90,7 +90,7 @@ public: static DiagramItemProperties *createPropertiesEditor(QWidget *parent = 0); -protected slots: +public slots: void updateLayout(); protected: |