summaryrefslogtreecommitdiff
path: root/src/items/database
diff options
context:
space:
mode:
authorLukáš Lalinský <lalinsky@gmail.com>2008-12-12 16:01:05 +0100
committerLukáš Lalinský <lalinsky@gmail.com>2008-12-12 16:01:05 +0100
commit94d6d634c08870614cc1ce22e0f635aa8f3ab881 (patch)
tree481f6ba9d1d6f99fa20e3fe95ff46212940688e0 /src/items/database
parent1772e08823194ee25b3ebf444ef05290b6b33c68 (diff)
downloaddbmodel-94d6d634c08870614cc1ce22e0f635aa8f3ab881.tar.xz
Make diagram notation configurable
Diffstat (limited to 'src/items/database')
-rw-r--r--src/items/database/databaserelationship.cpp22
-rw-r--r--src/items/database/databaserelationship.h2
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: