From 21c3c09341d37da4af62baa5511510a2ec33b1e4 Mon Sep 17 00:00:00 2001 From: Simon De Backer Date: Wed, 10 Jun 2020 20:58:11 +0200 Subject: [PATCH] fix deprecated warning QHash This function is obsolete. Use QMultiHash instead. This function was introduced in Qt 4.3 - 5.14 --- sources/qetgraphicsitem/conductor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sources/qetgraphicsitem/conductor.cpp b/sources/qetgraphicsitem/conductor.cpp index 0c2ad3031..c317dbd8c 100644 --- a/sources/qetgraphicsitem/conductor.cpp +++ b/sources/qetgraphicsitem/conductor.cpp @@ -16,6 +16,8 @@ along with QElectroTech. If not, see . */ #include +#include + #include "conductor.h" #include "conductorsegment.h" #include "conductorsegmentprofile.h" @@ -236,7 +238,7 @@ void Conductor::updateConductorPath(const QPointF &p1, Qet::Orientation o1, cons qreal v_diff = (qAbs(new_rect.height()) - qAbs(profile_height)) * getSign(profile_height); // applique les differences aux segments - QHash segments_lengths; + QMultiHash segments_lengths; segments_lengths.unite(shareOffsetBetweenSegments(h_diff, conductor_profile.horizontalSegments())); segments_lengths.unite(shareOffsetBetweenSegments(v_diff, conductor_profile.verticalSegments())); @@ -257,7 +259,7 @@ void Conductor::updateConductorPath(const QPointF &p1, Qet::Orientation o1, cons // coefficient et offset a utiliser pour ce point qreal coeff = csp -> isHorizontal ? horiz_coeff : verti_coeff; - qreal offset_applied = segments_lengths[csp]; + qreal offset_applied = segments_lengths.value(csp); // applique l'offset et le coeff au point if (csp -> isHorizontal) {