From fc083fc667c4d28274bf9bd9f23fee1926b8db00 Mon Sep 17 00:00:00 2001 From: dismine Date: Sun, 5 Oct 2014 23:41:05 +0300 Subject: [PATCH] error: use of undeclared identifier 'sqrt'. --HG-- branch : develop --- src/app/tools/vabstracttool.cpp | 3 ++- src/app/visualization/visline.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index 8552290e6..2edf0952c 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -34,6 +34,7 @@ #include "../geometry/vpointf.h" #include "../undocommands/savetooloptions.h" #include "../widgets/vmaingraphicsview.h" +#include const QString VAbstractTool::AttrType = QStringLiteral("type"); const QString VAbstractTool::AttrMx = QStringLiteral("mx"); @@ -205,7 +206,7 @@ qint32 VAbstractTool::LineIntersectCircle(const QPointF ¢er, qreal radius, c } } // find distance from projection to points of intersection - qreal k = sqrt (radius * radius - d * d); + qreal k = qSqrt (radius * radius - d * d); qreal t = QLineF (QPointF (0, 0), QPointF (b, - a)).length(); // add to projection a vectors aimed to points of intersection p1 = addVector (p, QPointF (0, 0), QPointF (- b, a), k / t); diff --git a/src/app/visualization/visline.cpp b/src/app/visualization/visline.cpp index 2adcdc2a5..2cacce052 100644 --- a/src/app/visualization/visline.cpp +++ b/src/app/visualization/visline.cpp @@ -99,7 +99,7 @@ QPointF VisLine::Ray(const QPointF &firstPoint, const qreal &angle) const line.setAngle(angle); QRectF scRect = this->scene()->sceneRect(); - qreal diagonal = sqrt(pow(scRect.height(), 2) + pow(scRect.width(), 2)); + qreal diagonal = qSqrt(pow(scRect.height(), 2) + pow(scRect.width(), 2)); line.setLength(diagonal); if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier) {