Beispiel #1
0
void tst_QGeoCircle::radius()
{
    QGeoCircle c;
    c.setRadius(1.0);
    QCOMPARE(c.radius(), qreal(1.0));
    c.setRadius(5.0);
    QCOMPARE(c.radius(), qreal(5.0));
}
void GeoCircleValueType::setRadius(qreal radius)
{
    QGeoCircle c = v;

    if (c.radius() == radius)
        return;

    c.setRadius(radius);
    v = c;
}
Beispiel #3
0
void tst_QGeoCircle::translate()
{
    QFETCH(QGeoCoordinate, center);
    QFETCH(qreal, radius);
    QFETCH(double, lat);
    QFETCH(double, lon);
    QFETCH(QGeoCoordinate, newCenter);

    QGeoCircle c(center, radius);
    QGeoCircle d = c;

    c.translate(lat, lon);

    QCOMPARE(c.radius(), radius);
    QCOMPARE(c.center(), newCenter);

    c = d.translated(lat, lon);
    d.setRadius(1.0);

    QCOMPARE(c.radius(), radius);
    QCOMPARE(d.center(), center);
    QCOMPARE(c.center(), newCenter);
}