Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QGeoMapPolygonGeometry Class Reference

#include <qdeclarativepolygonmapitem_p_p.h>

Inheritance diagram for QGeoMapPolygonGeometry:
Collaboration diagram for QGeoMapPolygonGeometry:

Public Types

enum  MapBorderBehaviour { DrawOnce , Duplicate , WrapAround }

Public Member Functions

 QGeoMapPolygonGeometry ()
 \qmltype MapPolygon \nativetype QDeclarativePolygonMapItem \inqmlmodule QtLocation
void setAssumeSimple (bool value)
void updateSourcePoints (const QGeoMap &map, const QList< QList< QDoubleVector2D > > &path, MapBorderBehaviour wrapping=Duplicate)
QPainterPath srcPath () const
qreal maxCoord () const
Public Member Functions inherited from QGeoMapItemGeometry
 QGeoMapItemGeometry ()
virtual ~QGeoMapItemGeometry ()
bool isSourceDirty () const
bool isScreenDirty () const
void markSourceDirty ()
void markScreenDirty ()
void markFullScreenDirty ()
void markClean ()
void clearScreen ()
QGeoCoordinate geoLeftBound ()
QRectF sourceBoundingBox () const
QRectF screenBoundingBox () const
void clearBounds ()
QPointF firstPointOffset () const
const QGeoCoordinateorigin () const
QPainterPath screenOutline () const
virtual bool contains (const QPointF &screenPoint) const
QVector2D vertex (quint32 index) const
QList< QPointFvertices () const
QList< quint32indices () const
bool isIndexed () const
quint32 size () const
void clear ()

Protected Attributes

QPainterPath srcPath_
qreal maxCoord_ = 0.0
bool assumeSimple_ = false
Protected Attributes inherited from QGeoMapItemGeometry
bool sourceDirty_ = true
bool screenDirty_ = true
bool clipToViewport_ = true
bool preserveGeometry_ = false
QGeoCoordinate geoLeftBound_
QPointF firstPointOffset_
QPainterPath screenOutline_
QRectF sourceBounds_
QRectF screenBounds_
QGeoCoordinate srcOrigin_
QList< QPointFscreenVertices_
QList< quint32screenIndices_

Additional Inherited Members

Static Public Member Functions inherited from QGeoMapItemGeometry
static QList< QGeoCoordinatepath (const QGeoRectangle &rect)
static QList< QGeoCoordinateperimeter (const QGeoRectangle &rect)
static QList< QDoubleVector2DpathMercator (const QList< QGeoCoordinate > &p)
Public Attributes inherited from QGeoMapItemGeometry
bool m_dataChanged = false

Detailed Description

Definition at line 38 of file qdeclarativepolygonmapitem_p_p.h.

Member Enumeration Documentation

◆ MapBorderBehaviour

Enumerator
DrawOnce 
Duplicate 
WrapAround 

Definition at line 41 of file qdeclarativepolygonmapitem_p_p.h.

Constructor & Destructor Documentation

◆ QGeoMapPolygonGeometry()

QT_BEGIN_NAMESPACE QGeoMapPolygonGeometry::QGeoMapPolygonGeometry ( )
default

\qmltype MapPolygon \nativetype QDeclarativePolygonMapItem \inqmlmodule QtLocation

Since
QtLocation 5.5

The MapPolygon type displays a polygon on a Map.

The MapPolygon type displays a polygon on a Map, specified in terms of an ordered list of \l {QtPositioning::coordinate}{coordinates}. For best appearance and results, polygons should be simple (not self-intersecting).

Coordinates can be added or removed at any time using the \l addCoordinate and \l removeCoordinate methods. They can also be modified like any other list element in QML:

mapPolygon.path[0].latitude = 5;

For drawing rectangles with "straight" edges (same latitude across one edge, same latitude across the other), the \l MapRectangle type provides a simpler, two-point API.

By default, the polygon is displayed as a 1 pixel black border with no fill. To change its appearance, use the \l color, \l border.color and \l border.width properties.

Note
Since MapPolygons are geographic items, dragging a MapPolygon (through the use of \l MouseArea or \l PointHandler) causes its vertices to be recalculated in the geographic coordinate space. The edges retain the same geographic lengths (latitude and longitude differences between the vertices), but they remain straight. Apparent stretching of the item occurs when dragged to a different latitude.

Member Function Documentation

◆ maxCoord()

qreal QGeoMapPolygonGeometry::maxCoord ( ) const
inline

Definition at line 56 of file qdeclarativepolygonmapitem_p_p.h.

◆ setAssumeSimple()

void QGeoMapPolygonGeometry::setAssumeSimple ( bool value)
inline

Definition at line 49 of file qdeclarativepolygonmapitem_p_p.h.

◆ srcPath()

QPainterPath QGeoMapPolygonGeometry::srcPath ( ) const
inline

Definition at line 55 of file qdeclarativepolygonmapitem_p_p.h.

◆ updateSourcePoints()

void QGeoMapPolygonGeometry::updateSourcePoints ( const QGeoMap & map,
const QList< QList< QDoubleVector2D > > & basePaths,
MapBorderBehaviour wrapping = Duplicate )

Definition at line 107 of file qdeclarativepolygonmapitem.cpp.

Member Data Documentation

◆ assumeSimple_

bool QGeoMapPolygonGeometry::assumeSimple_ = false
protected

Definition at line 61 of file qdeclarativepolygonmapitem_p_p.h.

◆ maxCoord_

qreal QGeoMapPolygonGeometry::maxCoord_ = 0.0
protected

Definition at line 60 of file qdeclarativepolygonmapitem_p_p.h.

◆ srcPath_

QPainterPath QGeoMapPolygonGeometry::srcPath_
protected

Definition at line 59 of file qdeclarativepolygonmapitem_p_p.h.


The documentation for this class was generated from the following files: