Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QGeoAreaMonitor Class Reference

The QGeoAreaMonitor class enables the detection of proximity changes for a specified set of coordinates. More...

 #include <QGeoAreaMonitor>

Inherits QObject.

Properties

  • 1 property inherited from QObject

Public Functions

QGeoAreaMonitor ( QObject * parent )
virtual ~QGeoAreaMonitor () = 0
QGeoCoordinate center () const
qreal radius () const
virtual void setCenter ( const QGeoCoordinate & coordinate )
virtual void setRadius ( qreal radius )
  • 29 public functions inherited from QObject

Signals

void areaEntered ( const QGeoPositionInfo & update )
void areaExited ( const QGeoPositionInfo & update )

Static Public Members

QGeoAreaMonitor * createDefaultMonitor ( QObject * parent )
  • 4 static public members inherited from QObject

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QGeoAreaMonitor class enables the detection of proximity changes for a specified set of coordinates.

A QGeoAreaMonitor emits signals when the current position is in range, or has moved out of range, of a specified circular area. The area is specified by a coordinate (the center point) and a radius (in meters).

For example:

 public:
     MyClass::MyClass()
     {
         QGeoAreaMonitor *monitor = QGeoAreaMonitor::createDefaultMonitor();
         connect(monitor, SIGNAL(areaEntered(QGeoPositionInfo)),
                 this, SLOT(areaEntered(QGeoPositionInfo)));
         connect(monitor, SIGNAL(areaExited(QGeoPositionInfo)),
                 this, SLOT(areaExited(QGeoPositionInfo)));

         QGeoCoordinate bigBenLocation(51.50104, -0.124632);
         monitor->setCenter(bigBenLocation);
         monitor->setRadius(100);
     }

 public Q_SLOTS:
     void areaEntered(const QGeoPositionInfo &update)
     {
         qDebug() << "Now within 100 meters, current position is" << update.coordinate();
     }

     void areaExited(const QGeoPositionInfo &update)
     {
         qDebug() << "No longer within 100 meters, current position is" << update.coordinate();
     }

Property Documentation

center : QGeoCoordinate

This property holds the center of the area to be monitored.

When the center is set, if the radius has already been set and the current position is within the monitored area, areaEntered() is emitted immediately.

By default, contains an invalid coordinate.

Note: Subclass implementations must call the base implementation of setCenter() so that center() returns the correct value.

Access functions:

QGeoCoordinate center () const
virtual void setCenter ( const QGeoCoordinate & coordinate )

radius : qreal

This property holds the radius of the area to be monitored, in meters.

If the specified radius is less than the minimum supported radius, the radius is set to the minimum radius.

When this property is set, if the center coordinate has already been set and the current position is within the monitored area, areaEntered() is emitted immediately.

By default, this property is 0.

Note: Subclass implementations must call the base implementation of setRadius() so that radius() returns the correct value.

Access functions:

qreal radius () const
virtual void setRadius ( qreal radius )

Member Function Documentation

QGeoAreaMonitor::QGeoAreaMonitor ( QObject * parent )

Creates a monitor with the given parent.

QGeoAreaMonitor::~QGeoAreaMonitor () [pure virtual]

Destroys the monitor.

void QGeoAreaMonitor::areaEntered ( const QGeoPositionInfo & update ) [signal]

Emitted when the current position has moved from a position outside the monitored area to a position within the monitored area.

The update holds the new position.

void QGeoAreaMonitor::areaExited ( const QGeoPositionInfo & update ) [signal]

Emitted when the current position has moved from a position within the monitored area to a position outside the monitored area.

The update holds the new position.

QGeoAreaMonitor * QGeoAreaMonitor::createDefaultMonitor ( QObject * parent ) [static]

Creates and returns a monitor with the given parent that monitors areas using resources on the underlying system.

Returns 0 if the system has no support for position monitoring.

Note: Symbian applications will need to have the Location capability otherwise this will return 0.

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

[0]; s.parentNode.insertBefore(ga, s); })();
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtmobility-1.1
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web