From 132d9a55d309a2027b6ff62d1c82bc9dc4e04802 Mon Sep 17 00:00:00 2001 From: Jochen Becher Date: Tue, 3 Dec 2019 20:13:20 +0100 Subject: [PATCH] modeleditor: Improve debugging of relations on diagrams Change-Id: I39d357f0b2fffe2db93cd389110cf3fc995d6e59 Reviewed-by: Christian Stenger --- .../qmt/model_widgets_ui/propertiesviewmview.cpp | 15 +++++++++++++++ .../qmt/model_widgets_ui/propertiesviewmview.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp index 31c764c5ada..4af7b782859 100644 --- a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp +++ b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp @@ -1082,6 +1082,21 @@ void PropertiesView::MView::visitDItem(const DItem *item) void PropertiesView::MView::visitDRelation(const DRelation *relation) { visitDElement(relation); +#ifdef SHOW_DEBUG_PROPERTIES + if (!m_pointsLabel) { + m_pointsLabel = new QLabel(m_topWidget); + addRow(tr("Intermediate points:"), m_pointsLabel, "intermediate points"); + } + QString points; + for (const auto &point : relation->intermediatePoints()) { + if (!points.isEmpty()) + points.append(", "); + points.append(QString("(%1,%2)").arg(point.pos().x()).arg(point.pos().y())); + } + if (points.isEmpty()) + points = tr("none"); + m_pointsLabel->setText(points); +#endif } void PropertiesView::MView::visitDInheritance(const DInheritance *inheritance) diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.h b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.h index 60e4712bb37..0655b668896 100644 --- a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.h +++ b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.h @@ -256,6 +256,8 @@ protected: // DAnnotation QCheckBox *m_annotationAutoWidthCheckbox = nullptr; QComboBox *m_annotationVisualRoleSelector = nullptr; + // DRelation + QLabel *m_pointsLabel = nullptr; }; } // namespace qmt