QGeoPath Class The QGeoPath class defines a geographic path. More...  
 Header:
 #include <QGeoPath> 


 qmake:
 QT += positioning


 Since:
 Qt 5.9


 Inherits:
 QGeoShape



 List of all members, including inherited members  Properties  
path : QList<QGeoCoordinate> 
width : qreal   3 properties inherited from QGeoShape
  Public Functions  
 

QGeoPath()
 
 

QGeoPath(const QList<QGeoCoordinate> &path, const qreal &width = 0.0)
 
 

QGeoPath(const QGeoPath &other)
 
 

QGeoPath(const QGeoShape &other)
 
 

~QGeoPath()
 
 void 

addCoordinate(const QGeoCoordinate &coordinate)
 
 bool 

containsCoordinate(const QGeoCoordinate &coordinate) const
 
 QGeoCoordinate 

coordinateAt(int index) const
 
 void 

insertCoordinate(int index, const QGeoCoordinate &coordinate)
 
 double 

length(int indexFrom = 0, int indexTo = -1) const
 
 const QList<QGeoCoordinate> &

path() const
 
 void 

removeCoordinate(const QGeoCoordinate &coordinate)
 
 void 

removeCoordinate(int index)
 
 void 

replaceCoordinate(int index, const QGeoCoordinate &coordinate)
 
 void 

setPath(const QList<QGeoCoordinate> &path)
 
 void 

setWidth(const qreal &width)
 
 QString 

toString() const
 
 void 

translate(double degreesLatitude, double degreesLongitude)
 
 QGeoPath 

translated(double degreesLatitude, double degreesLongitude) const
 
 qreal 

width() const
 
 bool 

operator!=(const QGeoPath &other) const
 
 QGeoPath &

operator=(const QGeoPath &other)
 
 bool 

operator==(const QGeoPath &other) const
   10 public functions inherited from QGeoShape
  Detailed Description The QGeoPath class defines a geographic path. The path is defined by an ordered list of QGeoCoordinates. Each two adjacent elements in the path are intended to be connected together by the shortest line segment of constant bearing passing through both elements. This type of connection can cross the dateline in the longitudinal direction, but never crosses the poles. This is relevant for the calculation of the bounding box returned by QGeoShap8b7c:f320:99b9:690f:4595:cd17:293a:c069boundingGeoRectangle() for this shape, which will have the latitude of the top left corner set to the maximum latitude in the path point set. Similarly, the latitude of the bottom right corner will be the minimum latitude in the path point set. This class is a Q_GADGET. It can be directly used from C++ and QML.  Property Documentation 
path : QList<QGeoCoordinate> This property holds the list of coordinates for the geo path. The path is both invalid and empty if it contains no coordinate. A default constructed QGeoPath is therefore invalid. Access functions:  
 const QList<QGeoCoordinate> &

path() const
 
 void 

setPath(const QList<QGeoCoordinate> &path)
  
width : qreal
 Access functions:  
 qreal 

width() const
 
 void 

setWidth(const qreal &width)
   Member Function Documentation 
QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069QGeoPath() Constructs a new, empty geo path. 
QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069QGeoPath(const QList<QGeoCoordinate> &path, const qreal &width = 0.0) Constructs a new geo path from a list of coordinates (path and width). 
QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069QGeoPath(const QGeoPath &other) Constructs a new geo path from the contents of other. 
QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069QGeoPath(const QGeoShape &other) Constructs a new geo path from the contents of other. 
QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069~QGeoPath() Destroys this path. 
void QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069oordinate(const QGeoCoordinate &coordinate) Appends coordinate to the path. 
bool QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069ontainsCoordinate(const QGeoCoordinate &coordinate) const Returns true if the path contains coordinate as one of the elements. 
QGeoCoordinate QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069oordinateAt(int index) const Returns the coordinate at index . 
void QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069insertCoordinate(int index, const QGeoCoordinate &coordinate) Inserts coordinate at the specified index. 
double QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069length(int indexFrom = 0, int indexTo = -1) const Returns the length of the path, in meters, from the element indexFrom to the element indexTo. The length is intended to be the sum of the shortest distances for each pair of adjacent points. 
const QList<QGeoCoordinate> &QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069path() const Returns all the elements. Equivalent to QGeoShap8b7c:f320:99b9:690f:4595:cd17:293a:c069center(). The center coordinate, in case of a QGeoPath, is the center of its bounding box. Note: Getter function for property path. 
See also setPath(). 
void QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069removeCoordinate(const QGeoCoordinate &coordinate) Removes the last occurrence of coordinate from the path. 
void QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069removeCoordinate(int index) Removes element at position index from the path. 
void QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069replaceCoordinate(int index, const QGeoCoordinate &coordinate) Replaces the path element at the specified index with coordinate. 
QString QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069toString() const Returns the geo path properties as a string. 
void QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069translate(double degreesLatitude, double degreesLongitude) Translates this geo path by degreesLatitude northwards and degreesLongitude eastwards. Negative values of degreesLatitude and degreesLongitude correspond to southward and westward translation respectively. 
QGeoPath QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069translated(double degreesLatitude, double degreesLongitude) const Returns a copy of this geo path translated by degreesLatitude northwards and degreesLongitude eastwards. Negative values of degreesLatitude and degreesLongitude correspond to southward and westward translation respectively. See also translate(). 
qreal QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069width() const Returns the width of the path, in meters. This information is used in the contains method The default value is 0. Note: Getter function for property width. 
See also setWidth(). 
bool QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069operator!=(const QGeoPath &other) const Returns whether this geo path is not equal to other. 
QGeoPath &QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069operator=(const QGeoPath &other) Assigns other to this geo path and returns a reference to this geo path. 
bool QGeoPath8b7c:f320:99b9:690f:4595:cd17:293a:c069operator==(const QGeoPath &other) const Returns whether this geo path is equal to other.

    
{'path': 'public/docs/qt~5.9/qgeopath.html', 'source': 'DevDocs.IO'}