The QGeoPositionInfo class contains information gathered on a global position, direction and velocity at a particular point in time. 更多...
头: | #include <QGeoPositionInfo> |
qmake: | QT += positioning |
Since: | Qt 5.2 |
enum | Attribute { Direction, GroundSpeed, VerticalSpeed, MagneticVariation, HorizontalAccuracy, VerticalAccuracy } |
QGeoPositionInfo () | |
QGeoPositionInfo (const QGeoCoordinate & coordinate , const QDateTime & timestamp ) | |
QGeoPositionInfo (const QGeoPositionInfo & other ) | |
QGeoPositionInfo (QGeoPositionInfoPrivate & dd ) | |
~QGeoPositionInfo () | |
qreal | 属性 (QGeoPositionInfo::Attribute 属性 ) const |
QGeoCoordinate | coordinate () const |
bool | hasAttribute (QGeoPositionInfo::Attribute 属性 ) const |
bool | isValid () const |
void | removeAttribute (QGeoPositionInfo::Attribute 属性 ) |
void | setAttribute (QGeoPositionInfo::Attribute 属性 , qreal value ) |
void | setCoordinate (const QGeoCoordinate & coordinate ) |
void | setTimestamp (const QDateTime & timestamp ) |
QDateTime | timestamp () const |
bool | operator!= (const QGeoPositionInfo & other ) const |
QGeoPositionInfo & | operator= (const QGeoPositionInfo & other ) |
bool | operator== (const QGeoPositionInfo & other ) const |
QDataStream & | operator<< (QDataStream & stream , QGeoPositionInfo::Attribute attr ) |
QDataStream & | operator<< (QDataStream & stream , const QGeoPositionInfo & info ) |
QDataStream & | operator>> (QDataStream & stream , QGeoPositionInfo::Attribute & attr ) |
QDataStream & | operator>> (QDataStream & stream , QGeoPositionInfo & info ) |
The QGeoPositionInfo class contains information gathered on a global position, direction and velocity at a particular point in time.
A QGeoPositionInfo contains, at a minimum, a geographical coordinate and a timestamp. It may also have heading and speed measurements as well as estimates of the accuracy of the provided data.
另请参阅 QGeoPositionInfoSource .
Defines the attributes for positional information.
常量 | 值 | 描述 |
---|---|---|
QGeoPositionInfo::Direction
|
0
|
The bearing measured in degrees clockwise from true north to the direction of travel. |
QGeoPositionInfo::GroundSpeed
|
1
|
The ground speed, in meters/sec. |
QGeoPositionInfo::VerticalSpeed
|
2
|
The vertical speed, in meters/sec. |
QGeoPositionInfo::MagneticVariation
|
3
|
The angle between the horizontal component of the magnetic field and true north, in degrees. Also known as magnetic declination. A positive value indicates a clockwise direction from true north and a negative value indicates a counter-clockwise direction. |
QGeoPositionInfo::HorizontalAccuracy
|
4
|
The accuracy of the provided latitude-longitude value, in meters. |
QGeoPositionInfo::VerticalAccuracy
|
5
|
The accuracy of the provided altitude value, in meters. |
Creates an invalid QGeoPositionInfo 对象。
另请参阅 isValid ().
创建 QGeoPositionInfo 为给定 coordinate and timestamp .
创建 QGeoPositionInfo with the values of other .
Default constructs an instance of QGeoPositionInfo.
销毁 QGeoPositionInfo 对象。
Returns the value of the specified 属性 as a qreal value.
Returns NaN if the value has not been set.
函数 hasAttribute () should be used to determine whether or not a value has been set for an attribute.
另请参阅 hasAttribute () 和 setAttribute ().
Returns the coordinate for this position.
Returns an invalid coordinate if no coordinate has been set.
另请参阅 setCoordinate ().
返回 true 若指定 属性 is present for this QGeoPositionInfo 对象。
返回 true 若 timestamp () 和 coordinate () values are both valid.
另请参阅 QGeoCoordinate::isValid () 和 QDateTime::isValid ().
移除指定 属性 and its value.
Sets the value for 属性 to value .
另请参阅 属性 ().
Sets the coordinate for this position to coordinate .
另请参阅 coordinate ().
Sets the date and time at which this position was reported to timestamp .
The timestamp must be in UTC time.
另请参阅 timestamp ().
Returns the date and time at which this position was reported, in UTC time.
Returns an invalid QDateTime if no date/time value has been set.
另请参阅 setTimestamp ().
Returns true if any of this object's values are not the same as those of other .
Assigns the values from other 到此 QGeoPositionInfo .
Returns true if all of this object's values are the same as those of other .
写入给定 attr enumeration to the specified stream .
另请参阅 序列化 Qt 数据类型 .
写入给定 info 到指定 stream .
另请参阅 序列化 Qt 数据类型 .
Reads an attribute enumeration from the specified stream info the given attr .
另请参阅 序列化 Qt 数据类型 .
Reads a coordinate from the specified stream 进给定 info .
另请参阅 序列化 Qt 数据类型 .