The QGeoAreaMonitorInfo class describes the parameters of an area or region to be monitored for proximity. 更多...
| 頭: | #include <QGeoAreaMonitorInfo> |
| qmake: | QT += positioning |
| Since: | Qt 5.2 |
| QGeoAreaMonitorInfo (const QString & name = QString()) | |
| QGeoAreaMonitorInfo (const QGeoAreaMonitorInfo & other ) | |
| ~QGeoAreaMonitorInfo () | |
| QGeoShape | area () const |
| QDateTime | expiration () const |
| QString | 標識符 () const |
| bool | isPersistent () const |
| bool | isValid () const |
| QString | name () const |
| QVariantMap | notificationParameters () const |
| void | setArea (const QGeoShape & newShape ) |
| void | setExpiration (const QDateTime & expiry ) |
| void | setName (const QString & name ) |
| void | setNotificationParameters (const QVariantMap & 參數 ) |
| void | setPersistent (bool isPersistent ) |
| bool | operator!= (const QGeoAreaMonitorInfo & other ) const |
| QGeoAreaMonitorInfo & | operator= (const QGeoAreaMonitorInfo & other ) |
| bool | operator== (const QGeoAreaMonitorInfo & other ) const |
| QDataStream & | operator<< (QDataStream & stream , const QGeoAreaMonitorInfo & monitor ) |
| QDataStream & | operator>> (QDataStream & stream , QGeoAreaMonitorInfo & monitor ) |
The QGeoAreaMonitorInfo class describes the parameters of an area or region to be monitored for proximity.
The purpose of area monitoring is to inform a user when he/she comes close to an area of interest. In general such an area is described by a QGeoCircle . The circle's center represents the place of interest and the area around it identifies the geographical region within which notifications are sent.
A QGeoAreaMonitorInfo object is valid if it has a non-empty name and a valid area (). Such objects must be registered with a QGeoAreaMonitorSource to start and stop the monitoring process. Note that extensive monitoring can be very resource consuming because the positioning engine must remain active and has to match the current position with each QGeoAreaMonitorInfo 實例。
To further reduce the burden on the system there are optional attributes which can set. Each monitored area can have an expiry date which automatically removes the to-be-monitored area from the monitoring source once the expiry date has been reached. Another option is to adjust the persistence of a monitored area. A QGeoAreaMonitorInfo that isPersistent () will remain active beyond the current applications lifetime. If an area is entered while the monitoring application is not running the application will be started. Note that this feature is not available on all platforms. Its availability can be checked via QGeoAreaMonitorSource::supportedAreaMonitorFeatures ().
另請參閱 QGeoAreaMonitorSource .
構造 QGeoAreaMonitorInfo object with the specified name .
另請參閱 name ().
構造 QGeoAreaMonitorInfo object as a copy of other .
析構函數
Returns the boundaries of the to-be-monitored area. This area must not be empty.
另請參閱 setArea ().
Returns the expiry date.
After an active QGeoAreaMonitorInfo has expired the region is no longer monitored and the QGeoAreaMonitorInfo object is removed from the list of active monitors .
If the expiry QDateTime is invalid the QGeoAreaMonitorInfo object is treated as not having an expiry date. This implies an indefinite monitoring period if the object is persistent or until the current application closes if the object is non-persistent.
另請參閱 setExpiration () 和 QGeoAreaMonitorSource::activeMonitors ().
Returns the identifier of the QGeoAreaMonitorInfo object. The identifier is automatically generated upon construction of a new QGeoAreaMonitorInfo 對象。
返迴 true 若 QGeoAreaMonitorInfo is persistent. The default value for this property is false.
A non-persistent QGeoAreaMonitorInfo will be removed by the system once the application owning the monitor object stops. Persistent objects remain active and can be retrieved once the application restarts.
If the system triggers an event associated to a persistent QGeoAreaMonitorInfo the relevant application will be re-started and the appropriate signal emitted.
另請參閱 setPersistent ().
Returns true, if the monitor is valid. A valid QGeoAreaMonitorInfo has a non-empty name () and the monitored area is not empty() . Otherwise this function returns false.
Returns the name of the QGeoAreaMonitorInfo object. The name should be used to for user-visibility purposes.
另請參閱 setName ().
Returns the set of platform specific paraemters used by this QGeoAreaMonitorInfo .
另請參閱 setNotificationParameters ().
Sets the to-be-monitored area to newShape .
另請參閱 area ().
Sets the expiry date and time to expiry .
另請參閱 expiration ().
Sets the user visibile name .
另請參閱 name ().
Sets the set of platform specific 參數 used by QGeoAreaMonitorInfo .
另請參閱 notificationParameters ().
設置 QGeoAreaMonitorInfo objects persistence to isPersistent .
Note that setting this flag does not imply that QGeoAreaMonitorInfoSource supports persistent monitoring. QGeoAreaMonitorSource::supportedAreaMonitorFeatures () can be used to check for this feature's availability.
另請參閱 isPersistent ().
Returns true if any of this object's values are not the same as those of other .
賦值 other 到此 QGeoAreaMonitorInfo 對象並返迴引用為此 QGeoAreaMonitorInfo 對象。
Returns true if all of this object's values are the same as those of other .
寫入給定 monitor 到指定 stream .
另請參閱 序列化 Qt 數據類型 .
Reads a area monitoring data from the specified stream 進給定 monitor .
另請參閱 序列化 Qt 數據類型 .