diff --git a/src/MissionManager/SurveyComplexItem.cc b/src/MissionManager/SurveyComplexItem.cc index 1edd4200bddb4144fa9e5528cd3df077a7ab88a5..f1c6461ae1ab0fdc416b9b6e694e1a9c28735eae 100644 --- a/src/MissionManager/SurveyComplexItem.cc +++ b/src/MissionManager/SurveyComplexItem.cc @@ -520,12 +520,20 @@ void SurveyComplexItem::_intersectLinesWithRect(const QList& lineList, c QLineF intersectLine; const QLineF& line = lineList[i]; + auto isLineBoundedIntersect = [&line, &intersectPoint](const QLineF& linePosition) { +#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) + return line.intersect(linePosition, &intersectPoint) == QLineF::BoundedIntersection; +#else + return line.intersects(linePosition, &intersectPoint) == QLineF::BoundedIntersection; +#endif + }; + int foundCount = 0; - if (line.intersect(topLine, &intersectPoint) == QLineF::BoundedIntersection) { + if (isLineBoundedIntersect(topLine)) { intersectLine.setP1(intersectPoint); foundCount++; } - if (line.intersect(rightLine, &intersectPoint) == QLineF::BoundedIntersection) { + if (isLineBoundedIntersect(rightLine)) { if (foundCount == 0) { intersectLine.setP1(intersectPoint); } else { @@ -536,7 +544,7 @@ void SurveyComplexItem::_intersectLinesWithRect(const QList& lineList, c } foundCount++; } - if (line.intersect(bottomLine, &intersectPoint) == QLineF::BoundedIntersection) { + if (isLineBoundedIntersect(bottomLine)) { if (foundCount == 0) { intersectLine.setP1(intersectPoint); } else { @@ -547,7 +555,7 @@ void SurveyComplexItem::_intersectLinesWithRect(const QList& lineList, c } foundCount++; } - if (line.intersect(leftLine, &intersectPoint) == QLineF::BoundedIntersection) { + if (isLineBoundedIntersect(leftLine)) { if (foundCount == 0) { intersectLine.setP1(intersectPoint); } else { @@ -577,7 +585,13 @@ void SurveyComplexItem::_intersectLinesWithPolygon(const QList& lineList for (int j=0; j