From 48cce42cfe199af692db97e9e393f2723c2ec949 Mon Sep 17 00:00:00 2001 From: Martin Marmsoler Date: Mon, 28 Sep 2020 15:42:57 +0200 Subject: [PATCH] fix wrong position of segments when loading file. This was, because not the segment property is asked, but the parent and this will not work additionally support legacy orientation --- sources/qetgraphicsitem/conductor.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sources/qetgraphicsitem/conductor.cpp b/sources/qetgraphicsitem/conductor.cpp index f99a8a8ab..73047a0c6 100644 --- a/sources/qetgraphicsitem/conductor.cpp +++ b/sources/qetgraphicsitem/conductor.cpp @@ -1102,11 +1102,21 @@ bool Conductor::pathFromXml(const QDomElement &e) { // le segment doit avoir une longueur qreal segment_length; - if (propertyDouble(e, "length", & segment_length)) + if (propertyDouble(current_segment, "length", & segment_length)) continue; - bool isHorizontal; - propertyBool(e, "orientation", &isHorizontal); + bool isHorizontal = false; + if (propertyBool(current_segment, "orientation", &isHorizontal) == PropertyFlags::NoValidConversion) { + // legacy + QString orientation; + if (propertyString(current_segment, "orientation", &orientation) == PropertyFlags::Success) { + if (orientation == "horizontal") + isHorizontal = true; + } else { + qDebug() << "PathFromXML failed"; + return false; + } + } if (isHorizontal) { segments_x << segment_length;