QLineF::IntersectType QLineF::intersect(const QLineF&, QPointF*) const' is

deprecated: Use intersects() instead.
(grafted from b8646bf40865848ad48eae89cae8419483d56f6b)

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2020-01-06 18:34:35 +02:00
parent 57b9868316
commit d74225e63e
13 changed files with 176 additions and 0 deletions

View File

@ -105,7 +105,11 @@ qreal CSR(qreal length, qreal split, qreal arcLength)
tmp.setAngle(tmp.angle()+angle*sign); tmp.setAngle(tmp.angle()+angle*sign);
QPointF crosPoint; 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); const auto type = line.intersect(tmp, &crosPoint);
#endif
if (type == QLineF::NoIntersection) if (type == QLineF::NoIntersection)
{ {
return 0; return 0;

View File

@ -401,7 +401,12 @@ QVector<QPointF> VAbstractCurve::CurveIntersectLine(const QVector<QPointF> &poin
for ( auto i = 0; i < points.count()-1; ++i ) for ( auto i = 0; i < points.count()-1; ++i )
{ {
QPointF crosPoint; 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); const auto type = line.intersect(QLineF(points.at(i), points.at(i+1)), &crosPoint);
#endif
if ( type == QLineF::BoundedIntersection ) if ( type == QLineF::BoundedIntersection )
{ {
intersections.append(crosPoint); intersections.append(crosPoint);

View File

@ -352,22 +352,45 @@ QPointF VGObject::LineIntersectRect(const QRectF &rec, const QLineF &line)
qreal x1, y1, x2, y2; qreal x1, y1, x2, y2;
rec.getCoords(&x1, &y1, &x2, &y2); rec.getCoords(&x1, &y1, &x2, &y2);
QPointF point; 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); QLineF::IntersectType type = line.intersect(QLineF(QPointF(x1, y1), QPointF(x1, y2)), &point);
#endif
if ( type == QLineF::BoundedIntersection ) if ( type == QLineF::BoundedIntersection )
{ {
return point; 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); type = line.intersect(QLineF(QPointF(x1, y1), QPointF(x2, y1)), &point);
#endif
if ( type == QLineF::BoundedIntersection ) if ( type == QLineF::BoundedIntersection )
{ {
return point; 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); type = line.intersect(QLineF(QPointF(x1, y2), QPointF(x2, y2)), &point);
#endif
if ( type == QLineF::BoundedIntersection ) if ( type == QLineF::BoundedIntersection )
{ {
return point; 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); type = line.intersect(QLineF(QPointF(x2, y1), QPointF(x2, y2)), &point);
#endif
if ( type == QLineF::BoundedIntersection ) if ( type == QLineF::BoundedIntersection )
{ {
return point; return point;
@ -479,7 +502,12 @@ QPointF VGObject::ClosestPoint(const QLineF &line, const QPointF &point)
qreal y = b + point.y(); qreal y = b + point.y();
QLineF lin (point, QPointF(x, y)); QLineF lin (point, QPointF(x, y));
QPointF p; 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); QLineF::IntersectType intersect = line.intersect(lin, &p);
#endif
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
{ {
return p; return p;

View File

@ -108,7 +108,12 @@ QVector<VRawSAPoint> AngleByLength(QVector<VRawSAPoint> points, QPointF p1, QPoi
// We do not check intersection type because intersection must alwayse exist // We do not check intersection type because intersection must alwayse exist
QPointF px; QPointF px;
cutLine.setAngle(cutLine.angle()+90); 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); QLineF::IntersectType type = QLineF(sp1, sp2).intersect(cutLine, &px);
#endif
if (type == QLineF::NoIntersection) if (type == QLineF::NoIntersection)
{ {
qDebug()<<"Couldn't find intersection with cut line."; qDebug()<<"Couldn't find intersection with cut line.";
@ -116,7 +121,12 @@ QVector<VRawSAPoint> AngleByLength(QVector<VRawSAPoint> points, QPointF p1, QPoi
points.append(px); points.append(px);
cutLine.setAngle(cutLine.angle()-180); 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); type = QLineF(sp2, sp3).intersect(cutLine, &px);
#endif
if (type == QLineF::NoIntersection) if (type == QLineF::NoIntersection)
{ {
qDebug()<<"Couldn't find intersection with cut line."; qDebug()<<"Couldn't find intersection with cut line.";
@ -226,7 +236,12 @@ QVector<VRawSAPoint> AngleByIntersection(const QVector<VRawSAPoint> &points, QPo
QLineF edge2(p2, p3); QLineF edge2(p2, p3);
QPointF px; 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); QLineF::IntersectType type = edge2.intersect(bigLine1, &px);
#endif
if (type == QLineF::NoIntersection) if (type == QLineF::NoIntersection)
{ {
return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback);
@ -261,7 +276,12 @@ QVector<VRawSAPoint> AngleByIntersection(const QVector<VRawSAPoint> &points, QPo
// Second point // Second point
QLineF edge1(p1, p2); QLineF edge1(p1, p2);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
type = edge1.intersects(bigLine2, &px);
#else
type = edge1.intersect(bigLine2, &px); type = edge1.intersect(bigLine2, &px);
#endif
if (type == QLineF::NoIntersection) if (type == QLineF::NoIntersection)
{ {
return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback);
@ -310,14 +330,24 @@ QVector<VRawSAPoint> AngleByFirstSymmetry(const QVector<VRawSAPoint> &points, QP
QLineF sEdge(VPointF::FlipPF(axis, bigLine2.p1()), VPointF::FlipPF(axis, bigLine2.p2())); QLineF sEdge(VPointF::FlipPF(axis, bigLine2.p1()), VPointF::FlipPF(axis, bigLine2.p2()));
QPointF px1; 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); QLineF::IntersectType type = sEdge.intersect(bigLine1, &px1);
#endif
if (type == QLineF::NoIntersection) if (type == QLineF::NoIntersection)
{ {
return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback);
} }
QPointF px2; QPointF px2;
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
type = sEdge.intersects(bigLine2, &px2);
#else
type = sEdge.intersect(bigLine2, &px2); type = sEdge.intersect(bigLine2, &px2);
#endif
if (type == QLineF::NoIntersection) if (type == QLineF::NoIntersection)
{ {
return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback);
@ -389,14 +419,24 @@ QVector<VRawSAPoint> AngleBySecondSymmetry(const QVector<VRawSAPoint> &points, Q
QLineF sEdge(VPointF::FlipPF(axis, bigLine1.p1()), VPointF::FlipPF(axis, bigLine1.p2())); QLineF sEdge(VPointF::FlipPF(axis, bigLine1.p1()), VPointF::FlipPF(axis, bigLine1.p2()));
QPointF px1; 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); QLineF::IntersectType type = sEdge.intersect(bigLine1, &px1);
#endif
if (type == QLineF::NoIntersection) if (type == QLineF::NoIntersection)
{ {
return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback);
} }
QPointF px2; QPointF px2;
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
type = sEdge.intersects(bigLine2, &px2);
#else
type = sEdge.intersect(bigLine2, &px2); type = sEdge.intersect(bigLine2, &px2);
#endif
if (type == QLineF::NoIntersection) if (type == QLineF::NoIntersection)
{ {
return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback);
@ -465,7 +505,12 @@ QVector<VRawSAPoint> AngleByFirstRightAngle(const QVector<VRawSAPoint> &points,
QLineF edge(p1, p2); QLineF edge(p1, p2);
QPointF px; 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); QLineF::IntersectType type = edge.intersect(bigLine2, &px);
#endif
if (type == QLineF::NoIntersection) if (type == QLineF::NoIntersection)
{ {
return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback);
@ -538,7 +583,12 @@ QVector<VRawSAPoint> AngleBySecondRightAngle(QVector<VRawSAPoint> points, QPoint
QLineF edge(p2, p3); QLineF edge(p2, p3);
QPointF px; 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); QLineF::IntersectType type = edge.intersect(bigLine1, &px);
#endif
if (type == QLineF::NoIntersection) if (type == QLineF::NoIntersection)
{ {
return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback);
@ -809,7 +859,11 @@ void RollbackBySecondEdgeRightAngle(QVector<VRawSAPoint> &ekvPoints, const QVect
const QLineF bigLine1 = VAbstractPiece::ParallelLine(points.at(points.size()-2), points.at(0), width); const QLineF bigLine1 = VAbstractPiece::ParallelLine(points.at(points.size()-2), points.at(0), width);
QPointF px; QPointF px;
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
edge.intersects(bigLine1, &px);
#else
edge.intersect(bigLine1, &px); edge.intersect(bigLine1, &px);
#endif
ekvPoints.removeLast(); ekvPoints.removeLast();
@ -821,7 +875,12 @@ void RollbackBySecondEdgeRightAngle(QVector<VRawSAPoint> &ekvPoints, const QVect
const QLineF edge2(ekvPoints.at(0), ekvPoints.at(1)); const QLineF edge2(ekvPoints.at(0), ekvPoints.at(1));
QPointF crosPoint; 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 ); const QLineF::IntersectType type = edge1.intersect(edge2, &crosPoint );
#endif
if (type == QLineF::BoundedIntersection) if (type == QLineF::BoundedIntersection)
{ {
ekvPoints.removeFirst(); ekvPoints.removeFirst();
@ -1252,7 +1311,11 @@ QVector<QPointF> VAbstractPiece::CheckLoops(const QVector<VRawSAPoint> &points)
if (uniqueVertices.size() == 4) if (uniqueVertices.size() == 4)
{// Lines are not neighbors {// 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); const QLineF::IntersectType intersect = line1.intersect(line2, &crosPoint);
#endif
if (intersect == QLineF::NoIntersection) if (intersect == QLineF::NoIntersection)
{ // According to the documentation QLineF::NoIntersection indicates that the lines do not intersect; { // 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. // i.e. they are parallel. But parallel also mean they can be on the same line.
@ -1332,7 +1395,12 @@ QVector<VRawSAPoint> VAbstractPiece::EkvPoint(QVector<VRawSAPoint> points, const
} }
QPointF crosPoint; 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 ); const QLineF::IntersectType type = bigLine1.intersect( bigLine2, &crosPoint );
#endif
switch (type) switch (type)
{// There are at least three big cases {// There are at least three big cases
case (QLineF::BoundedIntersection): case (QLineF::BoundedIntersection):
@ -1429,7 +1497,11 @@ QT_WARNING_POP
const QLineF bigEdge = ParallelLine(p1Line1, p1Line2, localWidth ); const QLineF bigEdge = ParallelLine(p1Line1, p1Line2, localWidth );
QPointF px; 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); const QLineF::IntersectType type = bigEdge.intersect(line, &px);
#endif
if (type != QLineF::BoundedIntersection && line.length() < QLineF(p2Line1, px).length()) if (type != QLineF::BoundedIntersection && line.length() < QLineF(p2Line1, px).length())
{ {
points.append(crosPoint); points.append(crosPoint);
@ -1560,7 +1632,12 @@ bool VAbstractPiece::IsAllowanceValid(const QVector<QPointF> &base, const QVecto
} }
QPointF crosPoint; 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); const auto type = baseSegment.intersect(allowanceSegment, &crosPoint);
#endif
if (type == QLineF::BoundedIntersection if (type == QLineF::BoundedIntersection
&& not VFuzzyComparePoints(baseSegment.p1(), crosPoint) && not VFuzzyComparePoints(baseSegment.p1(), crosPoint)
&& not VFuzzyComparePoints(baseSegment.p2(), crosPoint) && not VFuzzyComparePoints(baseSegment.p2(), crosPoint)
@ -1718,7 +1795,12 @@ QVector<VRawSAPoint> VAbstractPiece::RollbackSeamAllowance(QVector<VRawSAPoint>
{ {
QLineF segment(points.at(i), points.at(i-1)); QLineF segment(points.at(i), points.at(i-1));
QPointF crosPoint; 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); const QLineF::IntersectType type = cuttingEdge.intersect(segment, &crosPoint);
#endif
if (type != QLineF::NoIntersection if (type != QLineF::NoIntersection
&& VGObject::IsPointOnLineSegment(crosPoint, segment.p1(), segment.p2()) && VGObject::IsPointOnLineSegment(crosPoint, segment.p1(), segment.p2())
&& IsSameDirection(cuttingEdge.p2(), cuttingEdge.p1(), crosPoint)) && IsSameDirection(cuttingEdge.p2(), cuttingEdge.p1(), crosPoint))
@ -1738,7 +1820,12 @@ QVector<VRawSAPoint> VAbstractPiece::RollbackSeamAllowance(QVector<VRawSAPoint>
{ {
QPointF crosPoint; QPointF crosPoint;
QLineF secondLast(points.at(points.size()-2), points.at(points.size()-1)); 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); QLineF::IntersectType type = secondLast.intersect(cuttingEdge, &crosPoint);
#endif
if (type != QLineF::NoIntersection && IsOutsidePoint(secondLast.p1(), secondLast.p2(), crosPoint)) if (type != QLineF::NoIntersection && IsOutsidePoint(secondLast.p1(), secondLast.p2(), crosPoint))
{ {
points.append(crosPoint); points.append(crosPoint);

View File

@ -239,7 +239,11 @@ void DialogLineIntersect::PointNameChanged()
QLineF line1(static_cast<QPointF>(*p1Line1), static_cast<QPointF>(*p2Line1)); QLineF line1(static_cast<QPointF>(*p1Line1), static_cast<QPointF>(*p2Line1));
QLineF line2(static_cast<QPointF>(*p1Line2), static_cast<QPointF>(*p2Line2)); QLineF line2(static_cast<QPointF>(*p1Line2), static_cast<QPointF>(*p2Line2));
QPointF fPoint; 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); QLineF::IntersectType intersect = line1.intersect(line2, &fPoint);
#endif
flagError = not (set.size() < 3 || intersect == QLineF::NoIntersection); flagError = not (set.size() < 3 || intersect == QLineF::NoIntersection);
@ -281,7 +285,11 @@ bool DialogLineIntersect::CheckIntersecion()
QLineF line1(static_cast<QPointF>(*p1L1), static_cast<QPointF>(*p2L1)); QLineF line1(static_cast<QPointF>(*p1L1), static_cast<QPointF>(*p2L1));
QLineF line2(static_cast<QPointF>(*p1L2), static_cast<QPointF>(*p2L2)); QLineF line2(static_cast<QPointF>(*p1L2), static_cast<QPointF>(*p2L2));
QPointF fPoint; 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); QLineF::IntersectType intersect = line1.intersect(line2, &fPoint);
#endif
return intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection; return intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection;
} }
catch (const VExceptionBadId &) catch (const VExceptionBadId &)

View File

@ -78,7 +78,11 @@ void VToolTrueDarts::FindPoint(const QPointF &baseLineP1, const QPointF &baseLin
QLineF d2blP2(dartP2, baseLineP2); QLineF d2blP2(dartP2, baseLineP2);
d2blP2.setAngle(d2blP2.angle()+degrees); 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) if (QLineF(baseLineP1, d2blP2.p2()).intersect(d2d1, &p1) == QLineF::NoIntersection)
#endif
{ {
p1 = QPointF(0, 0); p1 = QPointF(0, 0);
p2 = QPointF(0, 0); p2 = QPointF(0, 0);

View File

@ -180,7 +180,12 @@ bool VToolLineIntersectAxis::FindPoint(const QLineF &axis, const QLineF &line, Q
SCASSERT(intersectionPoint != nullptr) SCASSERT(intersectionPoint != nullptr)
QPointF fPoint; 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); QLineF::IntersectType intersect = axis.intersect(line, &fPoint);
#endif
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
{ {
if(VFuzzyComparePossibleNulls(axis.angle(), line.angle()) if(VFuzzyComparePossibleNulls(axis.angle(), line.angle())

View File

@ -140,7 +140,12 @@ VToolLineIntersect* VToolLineIntersect::Create(VToolLineIntersectInitData initDa
QLineF line1(static_cast<QPointF>(*p1Line1), static_cast<QPointF>(*p2Line1)); QLineF line1(static_cast<QPointF>(*p1Line1), static_cast<QPointF>(*p2Line1));
QLineF line2(static_cast<QPointF>(*p1Line2), static_cast<QPointF>(*p2Line2)); QLineF line2(static_cast<QPointF>(*p1Line2), static_cast<QPointF>(*p2Line2));
QPointF fPoint; 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); const QLineF::IntersectType intersect = line1.intersect(line2, &fPoint);
#endif
if (intersect == QLineF::NoIntersection) if (intersect == QLineF::NoIntersection)
{ {
qWarning() << tr("Error calculating point '%1'. Lines (%2;%3) and (%4;%5) have no point of intersection") qWarning() << tr("Error calculating point '%1'. Lines (%2;%3) and (%4;%5) have no point of intersection")

View File

@ -201,7 +201,12 @@ bool VToolTriangle::FindPoint(const QPointF &axisP1, const QPointF &axisP2, cons
QLineF hypotenuse(firstPoint, secondPoint); QLineF hypotenuse(firstPoint, secondPoint);
QPointF startPoint; 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); QLineF::IntersectType intersect = axis.intersect(hypotenuse, &startPoint);
#endif
if (intersect != QLineF::UnboundedIntersection && intersect != QLineF::BoundedIntersection) if (intersect != QLineF::UnboundedIntersection && intersect != QLineF::BoundedIntersection)
{ {
return false; return false;

View File

@ -116,7 +116,12 @@ void VisToolHeight::setLineP2Id(const quint32 &value)
void VisToolHeight::ShowIntersection(const QLineF &height_line, const QLineF &base_line) void VisToolHeight::ShowIntersection(const QLineF &height_line, const QLineF &base_line)
{ {
QPointF p; 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); QLineF::IntersectType intersect = height_line.intersect(base_line, &p);
#endif
if (intersect == QLineF::UnboundedIntersection) if (intersect == QLineF::UnboundedIntersection)
{ {
line_intersection->setVisible(true); line_intersection->setVisible(true);

View File

@ -87,7 +87,12 @@ void VisToolLineIntersect::RefreshGeometry()
QLineF l1(static_cast<QPointF>(*first), static_cast<QPointF>(*second)); QLineF l1(static_cast<QPointF>(*first), static_cast<QPointF>(*second));
QLineF l2(static_cast<QPointF>(*third), Visualization::scenePos); QLineF l2(static_cast<QPointF>(*third), Visualization::scenePos);
QPointF fPoint; 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); QLineF::IntersectType intersect = l1.intersect(l2, &fPoint);
#endif
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
{ {
DrawPoint(point, fPoint, mainColor); DrawPoint(point, fPoint, mainColor);
@ -103,7 +108,12 @@ void VisToolLineIntersect::RefreshGeometry()
QLineF l1(static_cast<QPointF>(*first), static_cast<QPointF>(*second)); QLineF l1(static_cast<QPointF>(*first), static_cast<QPointF>(*second));
QLineF l2(static_cast<QPointF>(*third), static_cast<QPointF>(*forth)); QLineF l2(static_cast<QPointF>(*third), static_cast<QPointF>(*forth));
QPointF fPoint; 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); QLineF::IntersectType intersect = l1.intersect(l2, &fPoint);
#endif
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
{ {
DrawPoint(point, fPoint, mainColor); DrawPoint(point, fPoint, mainColor);

View File

@ -140,7 +140,12 @@ void VisToolLineIntersectAxis::setAxisPointId(const quint32 &value)
void VisToolLineIntersectAxis::ShowIntersection(const QLineF &axis_line, const QLineF &base_line) void VisToolLineIntersectAxis::ShowIntersection(const QLineF &axis_line, const QLineF &base_line)
{ {
QPointF p; 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); QLineF::IntersectType intersect = axis_line.intersect(base_line, &p);
#endif
if (intersect == QLineF::UnboundedIntersection) if (intersect == QLineF::UnboundedIntersection)
{ {
line_intersection->setVisible(true); line_intersection->setVisible(true);

View File

@ -97,7 +97,12 @@ void VisToolPointOfIntersection::setPoint2Id(const quint32 &value)
void VisToolPointOfIntersection::ShowIntersection(const QLineF &axis1, const QLineF &axis2, const QColor &color) void VisToolPointOfIntersection::ShowIntersection(const QLineF &axis1, const QLineF &axis2, const QColor &color)
{ {
QPointF p; 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); QLineF::IntersectType intersect = axis1.intersect(axis2, &p);
#endif
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
{ {
point->setVisible(true); point->setVisible(true);