QGeoShape QDeclarativeGeoMap::visibleRegion() const { if (!width() || !height()) return QGeoShape(); QGeoCoordinate tl = m_map->itemPositionToCoordinate(QDoubleVector2D(0, 0)); QGeoCoordinate br = m_map->itemPositionToCoordinate(QDoubleVector2D(width(), height())); return QGeoRectangle(tl, br); }
void QPlaceSearchRequestPrivate::clear() { limit = -1; searchTerm.clear(); categories.clear(); searchArea = QGeoShape(); recommendationId.clear(); visibilityScope = QLocation::UnspecifiedVisibility; relevanceHint = QPlaceSearchRequest::UnspecifiedHint; searchContext.clear(); }
void tst_QGeoCircle::areaComparison_data() { QTest::addColumn<QGeoShape>("area"); QTest::addColumn<QGeoCircle>("circle"); QTest::addColumn<bool>("equal"); QGeoCircle c1(QGeoCoordinate(10.0, 0.0), 10.0); QGeoCircle c2(QGeoCoordinate(20.0, 10.0), 20.0); QGeoRectangle b(QGeoCoordinate(10.0, 0.0), QGeoCoordinate(0.0, 10.0)); QTest::newRow("default constructed") << QGeoShape() << QGeoCircle() << false; QTest::newRow("c1 c1") << QGeoShape(c1) << c1 << true; QTest::newRow("c1 c2") << QGeoShape(c1) << c2 << false; QTest::newRow("c2 c1") << QGeoShape(c2) << c1 << false; QTest::newRow("c2 c2") << QGeoShape(c2) << c2 << true; QTest::newRow("b c1") << QGeoShape(b) << c1 << false; }
/*! \qmlmethod geoshape QtPositioning::shape() const Constructs an invalid geoshape. \sa {geoshape} */ QGeoShape LocationSingleton::shape() const { return QGeoShape(); }