modeleditor: Improve debugging of relations on diagrams

Change-Id: I39d357f0b2fffe2db93cd389110cf3fc995d6e59
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Jochen Becher
2019-12-03 20:13:20 +01:00
parent e16766f8a9
commit 132d9a55d3
2 changed files with 17 additions and 0 deletions

View File

@@ -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)

View File

@@ -256,6 +256,8 @@ protected:
// DAnnotation
QCheckBox *m_annotationAutoWidthCheckbox = nullptr;
QComboBox *m_annotationVisualRoleSelector = nullptr;
// DRelation
QLabel *m_pointsLabel = nullptr;
};
} // namespace qmt