diff --git a/src/libs/vtools/tools/vtooldetail.cpp b/src/libs/vtools/tools/vtooldetail.cpp index 7694f92cf..495591597 100644 --- a/src/libs/vtools/tools/vtooldetail.cpp +++ b/src/libs/vtools/tools/vtooldetail.cpp @@ -420,9 +420,16 @@ void VToolDetail::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio { if (scene()->views().count() > 0) { - QPoint pt0 = scene()->views().at(0)->mapFromScene(0, 0); - QPoint pt = scene()->views().at(0)->mapFromScene(0, 100); - qreal dScale = qSqrt(QPoint::dotProduct(pt - pt0, pt - pt0)); + const QPoint pt0 = scene()->views().at(0)->mapFromScene(0, 0); + const QPoint pt = scene()->views().at(0)->mapFromScene(0, 100); + + const QPoint p = pt - pt0; + +#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) + const qreal dScale = qSqrt(QPoint::dotProduct(p, p)); +#else + const qreal dScale = qSqrt(p.xp * p.xp + p.yp * p.yp); +#endif //QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) grainLine->SetScale(100/dScale); //qDebug() << "SCALE" << dScale << 10/dScale; }