From d74225e63eace99a9afa89e6157e4e99f29b7431 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 6 Jan 2020 18:34:35 +0200 Subject: [PATCH] QLineF::IntersectType QLineF::intersect(const QLineF&, QPointF*) const' is deprecated: Use intersects() instead. (grafted from b8646bf40865848ad48eae89cae8419483d56f6b) --HG-- branch : develop --- src/libs/qmuparser/qmuparser.cpp | 4 + src/libs/vgeometry/vabstractcurve.cpp | 5 ++ src/libs/vgeometry/vgobject.cpp | 28 ++++++ src/libs/vlayout/vabstractpiece.cpp | 87 +++++++++++++++++++ .../dialogs/tools/dialoglineintersect.cpp | 8 ++ .../tooldoublepoint/vtooltruedarts.cpp | 4 + .../toollinepoint/vtoollineintersectaxis.cpp | 5 ++ .../toolsinglepoint/vtoollineintersect.cpp | 5 ++ .../toolsinglepoint/vtooltriangle.cpp | 5 ++ .../visualization/line/vistoolheight.cpp | 5 ++ .../line/vistoollineintersect.cpp | 10 +++ .../line/vistoollineintersectaxis.cpp | 5 ++ .../line/vistoolpointofintersection.cpp | 5 ++ 13 files changed, 176 insertions(+) diff --git a/src/libs/qmuparser/qmuparser.cpp b/src/libs/qmuparser/qmuparser.cpp index f8ee6c27b..06e76cb19 100644 --- a/src/libs/qmuparser/qmuparser.cpp +++ b/src/libs/qmuparser/qmuparser.cpp @@ -105,7 +105,11 @@ qreal CSR(qreal length, qreal split, qreal arcLength) tmp.setAngle(tmp.angle()+angle*sign); QPointF crosPoint; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + const auto type = line.intersects(tmp, &crosPoint); +#else const auto type = line.intersect(tmp, &crosPoint); +#endif if (type == QLineF::NoIntersection) { return 0; diff --git a/src/libs/vgeometry/vabstractcurve.cpp b/src/libs/vgeometry/vabstractcurve.cpp index cd9eac433..2788bcfcb 100644 --- a/src/libs/vgeometry/vabstractcurve.cpp +++ b/src/libs/vgeometry/vabstractcurve.cpp @@ -401,7 +401,12 @@ QVector VAbstractCurve::CurveIntersectLine(const QVector &poin for ( auto i = 0; i < points.count()-1; ++i ) { QPointF crosPoint; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + const auto type = line.intersects(QLineF(points.at(i), points.at(i+1)), &crosPoint); +#else const auto type = line.intersect(QLineF(points.at(i), points.at(i+1)), &crosPoint); +#endif + if ( type == QLineF::BoundedIntersection ) { intersections.append(crosPoint); diff --git a/src/libs/vgeometry/vgobject.cpp b/src/libs/vgeometry/vgobject.cpp index a07b92c92..87cba67a7 100644 --- a/src/libs/vgeometry/vgobject.cpp +++ b/src/libs/vgeometry/vgobject.cpp @@ -352,22 +352,45 @@ QPointF VGObject::LineIntersectRect(const QRectF &rec, const QLineF &line) qreal x1, y1, x2, y2; rec.getCoords(&x1, &y1, &x2, &y2); QPointF point; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType type = line.intersects(QLineF(QPointF(x1, y1), QPointF(x1, y2)), &point); +#else QLineF::IntersectType type = line.intersect(QLineF(QPointF(x1, y1), QPointF(x1, y2)), &point); +#endif + if ( type == QLineF::BoundedIntersection ) { return point; } + +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + type = line.intersects(QLineF(QPointF(x1, y1), QPointF(x2, y1)), &point); +#else type = line.intersect(QLineF(QPointF(x1, y1), QPointF(x2, y1)), &point); +#endif + if ( type == QLineF::BoundedIntersection ) { return point; } + +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + type = line.intersects(QLineF(QPointF(x1, y2), QPointF(x2, y2)), &point); +#else type = line.intersect(QLineF(QPointF(x1, y2), QPointF(x2, y2)), &point); +#endif + if ( type == QLineF::BoundedIntersection ) { return point; } + +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + type = line.intersects(QLineF(QPointF(x2, y1), QPointF(x2, y2)), &point); +#else type = line.intersect(QLineF(QPointF(x2, y1), QPointF(x2, y2)), &point); +#endif + if ( type == QLineF::BoundedIntersection ) { return point; @@ -479,7 +502,12 @@ QPointF VGObject::ClosestPoint(const QLineF &line, const QPointF &point) qreal y = b + point.y(); QLineF lin (point, QPointF(x, y)); QPointF p; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType intersect = line.intersects(lin, &p); +#else QLineF::IntersectType intersect = line.intersect(lin, &p); +#endif + if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) { return p; diff --git a/src/libs/vlayout/vabstractpiece.cpp b/src/libs/vlayout/vabstractpiece.cpp index a8d848633..94cef227d 100644 --- a/src/libs/vlayout/vabstractpiece.cpp +++ b/src/libs/vlayout/vabstractpiece.cpp @@ -108,7 +108,12 @@ QVector AngleByLength(QVector points, QPointF p1, QPoi // We do not check intersection type because intersection must alwayse exist QPointF px; cutLine.setAngle(cutLine.angle()+90); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType type = QLineF(sp1, sp2).intersects(cutLine, &px); +#else QLineF::IntersectType type = QLineF(sp1, sp2).intersect(cutLine, &px); +#endif + if (type == QLineF::NoIntersection) { qDebug()<<"Couldn't find intersection with cut line."; @@ -116,7 +121,12 @@ QVector AngleByLength(QVector points, QPointF p1, QPoi points.append(px); cutLine.setAngle(cutLine.angle()-180); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + type = QLineF(sp2, sp3).intersects(cutLine, &px); +#else type = QLineF(sp2, sp3).intersect(cutLine, &px); +#endif + if (type == QLineF::NoIntersection) { qDebug()<<"Couldn't find intersection with cut line."; @@ -226,7 +236,12 @@ QVector AngleByIntersection(const QVector &points, QPo QLineF edge2(p2, p3); QPointF px; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType type = edge2.intersects(bigLine1, &px); +#else QLineF::IntersectType type = edge2.intersect(bigLine1, &px); +#endif + if (type == QLineF::NoIntersection) { return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); @@ -261,7 +276,12 @@ QVector AngleByIntersection(const QVector &points, QPo // Second point QLineF edge1(p1, p2); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + type = edge1.intersects(bigLine2, &px); +#else type = edge1.intersect(bigLine2, &px); +#endif + if (type == QLineF::NoIntersection) { return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); @@ -310,14 +330,24 @@ QVector AngleByFirstSymmetry(const QVector &points, QP QLineF sEdge(VPointF::FlipPF(axis, bigLine2.p1()), VPointF::FlipPF(axis, bigLine2.p2())); QPointF px1; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType type = sEdge.intersects(bigLine1, &px1); +#else QLineF::IntersectType type = sEdge.intersect(bigLine1, &px1); +#endif + if (type == QLineF::NoIntersection) { return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); } QPointF px2; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + type = sEdge.intersects(bigLine2, &px2); +#else type = sEdge.intersect(bigLine2, &px2); +#endif + if (type == QLineF::NoIntersection) { return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); @@ -389,14 +419,24 @@ QVector AngleBySecondSymmetry(const QVector &points, Q QLineF sEdge(VPointF::FlipPF(axis, bigLine1.p1()), VPointF::FlipPF(axis, bigLine1.p2())); QPointF px1; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType type = sEdge.intersects(bigLine1, &px1); +#else QLineF::IntersectType type = sEdge.intersect(bigLine1, &px1); +#endif + if (type == QLineF::NoIntersection) { return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); } QPointF px2; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + type = sEdge.intersects(bigLine2, &px2); +#else type = sEdge.intersect(bigLine2, &px2); +#endif + if (type == QLineF::NoIntersection) { return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); @@ -465,7 +505,12 @@ QVector AngleByFirstRightAngle(const QVector &points, QLineF edge(p1, p2); QPointF px; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType type = edge.intersects(bigLine2, &px); +#else QLineF::IntersectType type = edge.intersect(bigLine2, &px); +#endif + if (type == QLineF::NoIntersection) { return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); @@ -538,7 +583,12 @@ QVector AngleBySecondRightAngle(QVector points, QPoint QLineF edge(p2, p3); QPointF px; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType type = edge.intersects(bigLine1, &px); +#else QLineF::IntersectType type = edge.intersect(bigLine1, &px); +#endif + if (type == QLineF::NoIntersection) { return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); @@ -809,7 +859,11 @@ void RollbackBySecondEdgeRightAngle(QVector &ekvPoints, const QVect const QLineF bigLine1 = VAbstractPiece::ParallelLine(points.at(points.size()-2), points.at(0), width); QPointF px; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + edge.intersects(bigLine1, &px); +#else edge.intersect(bigLine1, &px); +#endif ekvPoints.removeLast(); @@ -821,7 +875,12 @@ void RollbackBySecondEdgeRightAngle(QVector &ekvPoints, const QVect const QLineF edge2(ekvPoints.at(0), ekvPoints.at(1)); QPointF crosPoint; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + const QLineF::IntersectType type = edge1.intersects(edge2, &crosPoint ); +#else const QLineF::IntersectType type = edge1.intersect(edge2, &crosPoint ); +#endif + if (type == QLineF::BoundedIntersection) { ekvPoints.removeFirst(); @@ -1252,7 +1311,11 @@ QVector VAbstractPiece::CheckLoops(const QVector &points) if (uniqueVertices.size() == 4) {// Lines are not neighbors +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + const QLineF::IntersectType intersect = line1.intersects(line2, &crosPoint); +#else const QLineF::IntersectType intersect = line1.intersect(line2, &crosPoint); +#endif if (intersect == QLineF::NoIntersection) { // According to the documentation QLineF::NoIntersection indicates that the lines do not intersect; // i.e. they are parallel. But parallel also mean they can be on the same line. @@ -1332,7 +1395,12 @@ QVector VAbstractPiece::EkvPoint(QVector points, const } QPointF crosPoint; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + const QLineF::IntersectType type = bigLine1.intersects( bigLine2, &crosPoint ); +#else const QLineF::IntersectType type = bigLine1.intersect( bigLine2, &crosPoint ); +#endif + switch (type) {// There are at least three big cases case (QLineF::BoundedIntersection): @@ -1429,7 +1497,11 @@ QT_WARNING_POP const QLineF bigEdge = ParallelLine(p1Line1, p1Line2, localWidth ); QPointF px; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + const QLineF::IntersectType type = bigEdge.intersects(line, &px); +#else const QLineF::IntersectType type = bigEdge.intersect(line, &px); +#endif if (type != QLineF::BoundedIntersection && line.length() < QLineF(p2Line1, px).length()) { points.append(crosPoint); @@ -1560,7 +1632,12 @@ bool VAbstractPiece::IsAllowanceValid(const QVector &base, const QVecto } QPointF crosPoint; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + const auto type = baseSegment.intersects(allowanceSegment, &crosPoint); +#else const auto type = baseSegment.intersect(allowanceSegment, &crosPoint); +#endif + if (type == QLineF::BoundedIntersection && not VFuzzyComparePoints(baseSegment.p1(), crosPoint) && not VFuzzyComparePoints(baseSegment.p2(), crosPoint) @@ -1718,7 +1795,12 @@ QVector VAbstractPiece::RollbackSeamAllowance(QVector { QLineF segment(points.at(i), points.at(i-1)); QPointF crosPoint; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + const QLineF::IntersectType type = cuttingEdge.intersects(segment, &crosPoint); +#else const QLineF::IntersectType type = cuttingEdge.intersect(segment, &crosPoint); +#endif + if (type != QLineF::NoIntersection && VGObject::IsPointOnLineSegment(crosPoint, segment.p1(), segment.p2()) && IsSameDirection(cuttingEdge.p2(), cuttingEdge.p1(), crosPoint)) @@ -1738,7 +1820,12 @@ QVector VAbstractPiece::RollbackSeamAllowance(QVector { QPointF crosPoint; QLineF secondLast(points.at(points.size()-2), points.at(points.size()-1)); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType type = secondLast.intersects(cuttingEdge, &crosPoint); +#else QLineF::IntersectType type = secondLast.intersect(cuttingEdge, &crosPoint); +#endif + if (type != QLineF::NoIntersection && IsOutsidePoint(secondLast.p1(), secondLast.p2(), crosPoint)) { points.append(crosPoint); diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp b/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp index dcafeceb4..c4b6059cb 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp +++ b/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp @@ -239,7 +239,11 @@ void DialogLineIntersect::PointNameChanged() QLineF line1(static_cast(*p1Line1), static_cast(*p2Line1)); QLineF line2(static_cast(*p1Line2), static_cast(*p2Line2)); QPointF fPoint; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType intersect = line1.intersects(line2, &fPoint); +#else QLineF::IntersectType intersect = line1.intersect(line2, &fPoint); +#endif flagError = not (set.size() < 3 || intersect == QLineF::NoIntersection); @@ -281,7 +285,11 @@ bool DialogLineIntersect::CheckIntersecion() QLineF line1(static_cast(*p1L1), static_cast(*p2L1)); QLineF line2(static_cast(*p1L2), static_cast(*p2L2)); QPointF fPoint; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType intersect = line1.intersects(line2, &fPoint); +#else QLineF::IntersectType intersect = line1.intersect(line2, &fPoint); +#endif return intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection; } catch (const VExceptionBadId &) diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp index 3835790da..ad8441e62 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp @@ -78,7 +78,11 @@ void VToolTrueDarts::FindPoint(const QPointF &baseLineP1, const QPointF &baseLin QLineF d2blP2(dartP2, baseLineP2); d2blP2.setAngle(d2blP2.angle()+degrees); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + if (QLineF(baseLineP1, d2blP2.p2()).intersects(d2d1, &p1) == QLineF::NoIntersection) +#else if (QLineF(baseLineP1, d2blP2.p2()).intersect(d2d1, &p1) == QLineF::NoIntersection) +#endif { p1 = QPointF(0, 0); p2 = QPointF(0, 0); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp index 3060e5173..8bf63a84f 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp @@ -180,7 +180,12 @@ bool VToolLineIntersectAxis::FindPoint(const QLineF &axis, const QLineF &line, Q SCASSERT(intersectionPoint != nullptr) QPointF fPoint; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType intersect = axis.intersects(line, &fPoint); +#else QLineF::IntersectType intersect = axis.intersect(line, &fPoint); +#endif + if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) { if(VFuzzyComparePossibleNulls(axis.angle(), line.angle()) diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp index 38bd499e6..cfc588d77 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp @@ -140,7 +140,12 @@ VToolLineIntersect* VToolLineIntersect::Create(VToolLineIntersectInitData initDa QLineF line1(static_cast(*p1Line1), static_cast(*p2Line1)); QLineF line2(static_cast(*p1Line2), static_cast(*p2Line2)); QPointF fPoint; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + const QLineF::IntersectType intersect = line1.intersects(line2, &fPoint); +#else const QLineF::IntersectType intersect = line1.intersect(line2, &fPoint); +#endif + if (intersect == QLineF::NoIntersection) { qWarning() << tr("Error calculating point '%1'. Lines (%2;%3) and (%4;%5) have no point of intersection") diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp index 39af8c1a8..5437b2583 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp @@ -201,7 +201,12 @@ bool VToolTriangle::FindPoint(const QPointF &axisP1, const QPointF &axisP2, cons QLineF hypotenuse(firstPoint, secondPoint); QPointF startPoint; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType intersect = axis.intersects(hypotenuse, &startPoint); +#else QLineF::IntersectType intersect = axis.intersect(hypotenuse, &startPoint); +#endif + if (intersect != QLineF::UnboundedIntersection && intersect != QLineF::BoundedIntersection) { return false; diff --git a/src/libs/vtools/visualization/line/vistoolheight.cpp b/src/libs/vtools/visualization/line/vistoolheight.cpp index 09ac1f6ef..1db72e474 100644 --- a/src/libs/vtools/visualization/line/vistoolheight.cpp +++ b/src/libs/vtools/visualization/line/vistoolheight.cpp @@ -116,7 +116,12 @@ void VisToolHeight::setLineP2Id(const quint32 &value) void VisToolHeight::ShowIntersection(const QLineF &height_line, const QLineF &base_line) { QPointF p; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType intersect = height_line.intersects(base_line, &p); +#else QLineF::IntersectType intersect = height_line.intersect(base_line, &p); +#endif + if (intersect == QLineF::UnboundedIntersection) { line_intersection->setVisible(true); diff --git a/src/libs/vtools/visualization/line/vistoollineintersect.cpp b/src/libs/vtools/visualization/line/vistoollineintersect.cpp index f9bb17621..f17906906 100644 --- a/src/libs/vtools/visualization/line/vistoollineintersect.cpp +++ b/src/libs/vtools/visualization/line/vistoollineintersect.cpp @@ -87,7 +87,12 @@ void VisToolLineIntersect::RefreshGeometry() QLineF l1(static_cast(*first), static_cast(*second)); QLineF l2(static_cast(*third), Visualization::scenePos); QPointF fPoint; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType intersect = l1.intersects(l2, &fPoint); +#else QLineF::IntersectType intersect = l1.intersect(l2, &fPoint); +#endif + if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) { DrawPoint(point, fPoint, mainColor); @@ -103,7 +108,12 @@ void VisToolLineIntersect::RefreshGeometry() QLineF l1(static_cast(*first), static_cast(*second)); QLineF l2(static_cast(*third), static_cast(*forth)); QPointF fPoint; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType intersect = l1.intersects(l2, &fPoint); +#else QLineF::IntersectType intersect = l1.intersect(l2, &fPoint); +#endif + if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) { DrawPoint(point, fPoint, mainColor); diff --git a/src/libs/vtools/visualization/line/vistoollineintersectaxis.cpp b/src/libs/vtools/visualization/line/vistoollineintersectaxis.cpp index e126bb1fb..7a7e3f65e 100644 --- a/src/libs/vtools/visualization/line/vistoollineintersectaxis.cpp +++ b/src/libs/vtools/visualization/line/vistoollineintersectaxis.cpp @@ -140,7 +140,12 @@ void VisToolLineIntersectAxis::setAxisPointId(const quint32 &value) void VisToolLineIntersectAxis::ShowIntersection(const QLineF &axis_line, const QLineF &base_line) { QPointF p; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType intersect = axis_line.intersects(base_line, &p); +#else QLineF::IntersectType intersect = axis_line.intersect(base_line, &p); +#endif + if (intersect == QLineF::UnboundedIntersection) { line_intersection->setVisible(true); diff --git a/src/libs/vtools/visualization/line/vistoolpointofintersection.cpp b/src/libs/vtools/visualization/line/vistoolpointofintersection.cpp index f9ab4273d..39eec28d5 100644 --- a/src/libs/vtools/visualization/line/vistoolpointofintersection.cpp +++ b/src/libs/vtools/visualization/line/vistoolpointofintersection.cpp @@ -97,7 +97,12 @@ void VisToolPointOfIntersection::setPoint2Id(const quint32 &value) void VisToolPointOfIntersection::ShowIntersection(const QLineF &axis1, const QLineF &axis2, const QColor &color) { QPointF p; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QLineF::IntersectType intersect = axis1.intersects(axis2, &p); +#else QLineF::IntersectType intersect = axis1.intersect(axis2, &p); +#endif + if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) { point->setVisible(true);