Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QGeoAreaMonitorInfo Class Reference

\inmodule QtPositioning More...

#include <qgeoareamonitorinfo.h>

+ Collaboration diagram for QGeoAreaMonitorInfo:

Public Member Functions

 QGeoAreaMonitorInfo (const QString &name=QString())
 Constructs a QGeoAreaMonitorInfo object with the specified name.
 
 QGeoAreaMonitorInfo (const QGeoAreaMonitorInfo &other)
 Constructs a QGeoAreaMonitorInfo object as a copy of other.
 
 QGeoAreaMonitorInfo (QGeoAreaMonitorInfo &&other) noexcept=default
 
 ~QGeoAreaMonitorInfo ()
 Destructor.
 
QGeoAreaMonitorInfooperator= (const QGeoAreaMonitorInfo &other)
 Assigns other to this QGeoAreaMonitorInfo object and returns a reference to this QGeoAreaMonitorInfo object.
 
void swap (QGeoAreaMonitorInfo &other) noexcept
 
QString name () const
 Returns the name of the QGeoAreaMonitorInfo object.
 
void setName (const QString &name)
 Sets the user visibile name.
 
QString identifier () const
 Returns the identifier of the QGeoAreaMonitorInfo object.
 
bool isValid () const
 Returns true, if the monitor is valid.
 
QGeoShape area () const
 Returns the boundaries of the to-be-monitored area.
 
void setArea (const QGeoShape &newShape)
 Sets the to-be-monitored area to newShape.
 
QDateTime expiration () const
 Returns the expiry date.
 
void setExpiration (const QDateTime &expiry)
 Sets the expiry date and time to expiry.
 
bool isPersistent () const
 Returns true if the QGeoAreaMonitorInfo is persistent.
 
void setPersistent (bool isPersistent)
 Sets the QGeoAreaMonitorInfo object's persistence to isPersistent.
 
QVariantMap notificationParameters () const
 Returns the set of platform specific parameters used by this QGeoAreaMonitorInfo.
 
void setNotificationParameters (const QVariantMap &parameters)
 Sets the set of platform specific parameters used by QGeoAreaMonitorInfo.
 
void detach ()
 

Friends

class QGeoAreaMonitorInfoPrivate
 
bool operator== (const QGeoAreaMonitorInfo &lhs, const QGeoAreaMonitorInfo &rhs)
 Returns true if all of the lhs object's values are the same as those of rhs object.
 
bool operator!= (const QGeoAreaMonitorInfo &lhs, const QGeoAreaMonitorInfo &rhs)
 Returns true if any of the lhs object's values are not the same as those of rhs object.
 
QDataStreamoperator<< (QDataStream &ds, const QGeoAreaMonitorInfo &monitor)
 Writes the given monitor to the specified stream.
 
QDataStreamoperator>> (QDataStream &ds, QGeoAreaMonitorInfo &monitor)
 Reads a area monitoring data from the specified stream into the given monitor.
 
Q_POSITIONING_EXPORT size_t qHash (const QGeoAreaMonitorInfo &key, size_t seed) noexcept
 
Q_POSITIONING_EXPORT char * QTest::toString (const QGeoAreaMonitorInfo &info)
 
QDebug operator<< (QDebug dbg, const QGeoAreaMonitorInfo &monitor)
 

Detailed Description

\inmodule QtPositioning

Since
5.2

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 \l 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 \l area(). Such objects must be registered with a \l 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 instance.

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 \l 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 \l QGeoAreaMonitorSource::supportedAreaMonitorFeatures().

See also
QGeoAreaMonitorSource

Definition at line 27 of file qgeoareamonitorinfo.h.

Constructor & Destructor Documentation

◆ QGeoAreaMonitorInfo() [1/3]

QGeoAreaMonitorInfo::QGeoAreaMonitorInfo ( const QString & name = QString())
explicit

Constructs a QGeoAreaMonitorInfo object with the specified name.

See also
name()

Definition at line 82 of file qgeoareamonitorinfo.cpp.

References QGeoAreaMonitorInfoPrivate::name, name(), and QGeoAreaMonitorInfoPrivate.

+ Here is the call graph for this function:

◆ QGeoAreaMonitorInfo() [2/3]

QGeoAreaMonitorInfo::QGeoAreaMonitorInfo ( const QGeoAreaMonitorInfo & other)

Constructs a QGeoAreaMonitorInfo object as a copy of other.

Definition at line 92 of file qgeoareamonitorinfo.cpp.

◆ QGeoAreaMonitorInfo() [3/3]

QGeoAreaMonitorInfo::QGeoAreaMonitorInfo ( QGeoAreaMonitorInfo && other)
defaultnoexcept
Since
6.2

Constructs a QGeoAreaMonitorInfo object by moving from other.

Note that a moved-from QGeoAreaMonitorInfo can only be destroyed or assigned to. The effect of calling other functions than the destructor or one of the assignment operators is undefined.

◆ ~QGeoAreaMonitorInfo()

QGeoAreaMonitorInfo::~QGeoAreaMonitorInfo ( )

Destructor.

Definition at line 111 of file qgeoareamonitorinfo.cpp.

Member Function Documentation

◆ area()

QGeoShape QGeoAreaMonitorInfo::area ( ) const

Returns the boundaries of the to-be-monitored area.

This area must not be empty.

See also
setArea()

Definition at line 199 of file qgeoareamonitorinfo.cpp.

References QGeoAreaMonitorInfoPrivate::shape.

◆ detach()

void QGeoAreaMonitorInfo::detach ( )

Definition at line 302 of file qgeoareamonitorinfo.cpp.

References QExplicitlySharedDataPointer< T >::detach(), and QGeoAreaMonitorInfoPrivate.

+ Here is the call graph for this function:

◆ expiration()

QDateTime QGeoAreaMonitorInfo::expiration ( ) const

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 \l {QGeoAreaMonitorSource::activeMonitors()}{active monitors}.

If the expiry \l 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.

See also
QGeoAreaMonitorSource::activeMonitors()

Definition at line 228 of file qgeoareamonitorinfo.cpp.

References QGeoAreaMonitorInfoPrivate::expiry.

Referenced by QGeoAreaMonitorPolling::requestUpdate(), and QGeoAreaMonitorPolling::startMonitoring().

+ Here is the caller graph for this function:

◆ identifier()

QString QGeoAreaMonitorInfo::identifier ( ) const

Returns the identifier of the QGeoAreaMonitorInfo object.

The identifier is automatically generated upon construction of a new QGeoAreaMonitorInfo object.

Definition at line 179 of file qgeoareamonitorinfo.cpp.

References QUuid::toString(), and QGeoAreaMonitorInfoPrivate::uid.

Referenced by QGeoAreaMonitorPollingPrivate::requestUpdate(), QGeoAreaMonitorPollingPrivate::startMonitoring(), and QGeoAreaMonitorPollingPrivate::stopMonitoring().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isPersistent()

bool QGeoAreaMonitorInfo::isPersistent ( ) const

Returns true if the 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.

See also
setPersistent()

Definition at line 255 of file qgeoareamonitorinfo.cpp.

References QGeoAreaMonitorInfoPrivate::persistent.

Referenced by QGeoAreaMonitorPolling::requestUpdate(), setPersistent(), and QGeoAreaMonitorPolling::startMonitoring().

+ Here is the caller graph for this function:

◆ isValid()

bool QGeoAreaMonitorInfo::isValid ( ) const

Returns true, if the monitor is valid.

A valid QGeoAreaMonitorInfo has a non-empty name() and the monitored area is not \l {QGeoShape::isEmpty()}{empty()}. Otherwise this function returns false.

Definition at line 189 of file qgeoareamonitorinfo.cpp.

References QString::isEmpty(), QGeoShape::isEmpty, QGeoAreaMonitorInfoPrivate::name, and QGeoAreaMonitorInfoPrivate::shape.

Referenced by QGeoAreaMonitorPolling::requestUpdate(), and QGeoAreaMonitorPolling::startMonitoring().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ name()

QString QGeoAreaMonitorInfo::name ( ) const

Returns the name of the QGeoAreaMonitorInfo object.

The name should be used for user-visibility purposes.

Definition at line 157 of file qgeoareamonitorinfo.cpp.

References QGeoAreaMonitorInfoPrivate::name.

Referenced by QGeoAreaMonitorInfo(), and setName().

+ Here is the caller graph for this function:

◆ notificationParameters()

QVariantMap QGeoAreaMonitorInfo::notificationParameters ( ) const

Returns the set of platform specific parameters used by this QGeoAreaMonitorInfo.

See also
setNotificationParameters()

Definition at line 283 of file qgeoareamonitorinfo.cpp.

References QGeoAreaMonitorInfoPrivate::notificationParameters.

◆ operator=()

QGeoAreaMonitorInfo & QGeoAreaMonitorInfo::operator= ( const QGeoAreaMonitorInfo & other)

Assigns other to this QGeoAreaMonitorInfo object and returns a reference to this QGeoAreaMonitorInfo object.

Since
6.2

Move-assigns other to this QGeoAreaMonitorInfo object and returns a reference to this QGeoAreaMonitorInfo object.

Note that a moved-from QGeoAreaMonitorInfo can only be destroyed or assigned to. The effect of calling other functions than the destructor or one of the assignment operators is undefined.

Definition at line 121 of file qgeoareamonitorinfo.cpp.

References d, and other().

+ Here is the call graph for this function:

◆ setArea()

void QGeoAreaMonitorInfo::setArea ( const QGeoShape & newShape)

Sets the to-be-monitored area to newShape.

See also
area()

Definition at line 209 of file qgeoareamonitorinfo.cpp.

References QExplicitlySharedDataPointer< T >::detach(), and QGeoAreaMonitorInfoPrivate::shape.

+ Here is the call graph for this function:

◆ setExpiration()

void QGeoAreaMonitorInfo::setExpiration ( const QDateTime & expiry)

Sets the expiry date and time to expiry.

Definition at line 236 of file qgeoareamonitorinfo.cpp.

References QExplicitlySharedDataPointer< T >::detach(), and QGeoAreaMonitorInfoPrivate::expiry.

+ Here is the call graph for this function:

◆ setName()

void QGeoAreaMonitorInfo::setName ( const QString & name)

Sets the user visibile name.

Definition at line 165 of file qgeoareamonitorinfo.cpp.

References QExplicitlySharedDataPointer< T >::detach(), QGeoAreaMonitorInfoPrivate::name, and name().

+ Here is the call graph for this function:

◆ setNotificationParameters()

void QGeoAreaMonitorInfo::setNotificationParameters ( const QVariantMap & parameters)

Sets the set of platform specific parameters used by QGeoAreaMonitorInfo.

See also
notificationParameters()

Definition at line 293 of file qgeoareamonitorinfo.cpp.

References QExplicitlySharedDataPointer< T >::detach(), and QGeoAreaMonitorInfoPrivate::notificationParameters.

+ Here is the call graph for this function:

◆ setPersistent()

void QGeoAreaMonitorInfo::setPersistent ( bool isPersistent)

Sets the QGeoAreaMonitorInfo object's persistence to isPersistent.

Note that setting this flag does not imply that \l QGeoAreaMonitorSource supports persistent monitoring. \l QGeoAreaMonitorSource::supportedAreaMonitorFeatures() can be used to check for this feature's availability.

See also
isPersistent()

Definition at line 270 of file qgeoareamonitorinfo.cpp.

References QExplicitlySharedDataPointer< T >::detach(), isPersistent(), and QGeoAreaMonitorInfoPrivate::persistent.

+ Here is the call graph for this function:

◆ swap()

void QGeoAreaMonitorInfo::swap ( QGeoAreaMonitorInfo & other)
inlinenoexcept

Definition at line 38 of file qgeoareamonitorinfo.h.

References d, and other().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

bool QGeoAreaMonitorInfo::operator!= ( const QGeoAreaMonitorInfo & lhs,
const QGeoAreaMonitorInfo & rhs )
friend

Returns true if any of the lhs object's values are not the same as those of rhs object.

Otherwise returns false.

Definition at line 44 of file qgeoareamonitorinfo.h.

◆ operator<< [1/2]

QDataStream & QGeoAreaMonitorInfo::operator<< ( QDataStream & stream,
const QGeoAreaMonitorInfo & monitor )
friend

Writes the given monitor to the specified stream.

See also
{Serializing Qt Data Types}

Definition at line 75 of file qgeoareamonitorinfo.h.

◆ operator<< [2/2]

QDebug operator<< ( QDebug dbg,
const QGeoAreaMonitorInfo & monitor )
friend

Definition at line 89 of file qgeoareamonitorinfo.h.

◆ operator==

bool QGeoAreaMonitorInfo::operator== ( const QGeoAreaMonitorInfo & lhs,
const QGeoAreaMonitorInfo & rhs )
friend

Returns true if all of the lhs object's values are the same as those of rhs object.

Otherwise returns false.

Definition at line 40 of file qgeoareamonitorinfo.h.

◆ operator>>

QDataStream & QGeoAreaMonitorInfo::operator>> ( QDataStream & stream,
QGeoAreaMonitorInfo & monitor )
friend

Reads a area monitoring data from the specified stream into the given monitor.

See also
{Serializing Qt Data Types}

Definition at line 79 of file qgeoareamonitorinfo.h.

◆ QGeoAreaMonitorInfoPrivate

friend class QGeoAreaMonitorInfoPrivate
friend

Definition at line 72 of file qgeoareamonitorinfo.h.

Referenced by QGeoAreaMonitorInfo(), and detach().

◆ qHash

Q_POSITIONING_EXPORT size_t qHash ( const QGeoAreaMonitorInfo & key,
size_t seed )
friend

Definition at line 388 of file qgeoareamonitorinfo.cpp.

◆ QTest::toString

Q_POSITIONING_EXPORT char * QTest::toString ( const QGeoAreaMonitorInfo & info)
friend

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