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  · 

QWhereaboutsCoordinate Class Reference
[QtLocationModule]

The QWhereaboutsCoordinate class contains a geographical coordinate. More...

    #include <QWhereaboutsCoordinate>

Public Types

  • enum CoordinateFormat { DecimalDegrees, DecimalDegreesWithHemisphere, DegreesMinutes, DegreesMinutesWithHemisphere, DegreesMinutesSeconds, DegreesMinutesSecondsWithHemisphere }
  • enum CoordinateType { InvalidCoordinate, Coordinate2D, Coordinate3D }

Public Functions


Detailed Description

The QWhereaboutsCoordinate class contains a geographical coordinate.

A QWhereaboutsCoordinate has a latitude and longitude, and optionally, an altitude.

Use type() to determine whether a coordinate is a 2D coordinate (has latitude and longitude only) or 3D coordinate (has latitude, longitude and altitude). Use distanceTo() and azimuthTo() to calculate the distance and bearing between coordinates.

See also QWhereabouts.


Member Type Documentation

enum QWhereaboutsCoordinate::CoordinateFormat

Defines the possible formatting options for toString().

ConstantValueDescription
QWhereaboutsCoordinate::DecimalDegrees0Returns a string representation of the coordinates in decimal degrees format.
QWhereaboutsCoordinate::DecimalDegreesWithHemisphere1Returns a string representation of the coordinates in decimal degrees format, using 'N', 'S', 'E' or 'W' to indicate the hemispheres of the coordinates.
QWhereaboutsCoordinate::DegreesMinutes2Returns a string representation of the coordinates in degrees-minutes format.
QWhereaboutsCoordinate::DegreesMinutesWithHemisphere3Returns a string representation of the coordinates in degrees-minutes format, using 'N', 'S', 'E' or 'W' to indicate the hemispheres of the coordinates.
QWhereaboutsCoordinate::DegreesMinutesSeconds4Returns a string representation of the coordinates in degrees-minutes-seconds format.
QWhereaboutsCoordinate::DegreesMinutesSecondsWithHemisphere5Returns a string representation of the coordinates in degrees-minutes-seconds format, using 'N', 'S', 'E' or 'W' to indicate the hemispheres of the coordinates.

See also toString().

enum QWhereaboutsCoordinate::CoordinateType

Defines the possible types for a coordinate.

ConstantValueDescription
QWhereaboutsCoordinate::InvalidCoordinate0The coordinate is neither a 2D nor 3D coordinate.
QWhereaboutsCoordinate::Coordinate2D1The coordinate has valid latitude and longitude values.
QWhereaboutsCoordinate::Coordinate3D2The coordinate has valid latitude, longitude and altitude values.


Member Function Documentation

QWhereaboutsCoordinate::QWhereaboutsCoordinate ()

Constructs a coordinate. The coordinate will be invalid until setLatitude() and setLongitude() have been called.

QWhereaboutsCoordinate::QWhereaboutsCoordinate ( double latitude, double longitude )

Constructs a coordinate with the given latitude and longitude.

QWhereaboutsCoordinate::QWhereaboutsCoordinate ( double latitude, double longitude, double altitude )

Constructs a coordinate with the given latitude, longitude and altitude.

QWhereaboutsCoordinate::QWhereaboutsCoordinate ( const QWhereaboutsCoordinate & other )

Constructs a coordinate from the contents of other.

QWhereaboutsCoordinate::~QWhereaboutsCoordinate ()

Destroys the coordinate object.

double QWhereaboutsCoordinate::altitude () const

Returns the altitude (meters above sea level).

See also setAltitude().

qreal QWhereaboutsCoordinate::azimuthTo ( const QWhereaboutsCoordinate & other )

Returns the azimuth (or bearing) in degrees from this coordinate to the coordinate specified by other. Altitude is not used in the calculation.

The calculation does not take the aspects of the geoid into account.

Returns 0 if the type of this coordinate or the type of other is QWhereaboutsCoordinate::InvalidCoordinate.

qreal QWhereaboutsCoordinate::distanceTo ( const QWhereaboutsCoordinate & other )

Returns the distance (in meters) from this coordinate to the coordinate specified by other. Altitude is not used in the calculation.

This calculation returns the great-circle distance between the two coordinates, without taking the aspects of the geoid into account.

Returns 0 if the type of this coordinate or the type of other is QWhereaboutsCoordinate::InvalidCoordinate.

bool QWhereaboutsCoordinate::isNull () const

Returns true if no attributes have been set for this coordinate.

double QWhereaboutsCoordinate::latitude () const

Returns the latitude, in decimal degrees. A positive latitude indicates the Northern Hemisphere, and a negative latitude indicates the Southern Hemisphere.

See also setLatitude().

double QWhereaboutsCoordinate::longitude () const

Returns the longitude, in decimal degrees. A positive longitude indicates the Eastern Hemisphere, and a negative longitude indicates the Western Hemisphere.

See also setLongitude().

void QWhereaboutsCoordinate::setAltitude ( double altitude )

Sets the altitude (meters above sea level) to altitude.

See also altitude().

void QWhereaboutsCoordinate::setLatitude ( double latitude )

Sets the latitude (in decimal degrees) to latitude. The value should be in the WGS84 datum.

To be valid, the latitude must be between -90 to 90 inclusive.

See also latitude().

void QWhereaboutsCoordinate::setLongitude ( double longitude )

Sets the longitude (in decimal degrees) to longitude. The value should be in the WGS84 datum.

To be valid, the longitude must be between -180 to 180 inclusive.

See also longitude().

QString QWhereaboutsCoordinate::toString ( CoordinateFormat format = DegreesMinutesSecondsWithHemisphere ) const

Returns this coordinate as a string in the specified format.

For example, if this coordinate latitude-longitude coordinates of (-27.46758°, 153.027892°), these are the strings that are returned depending on format:

format valueReturned string
DecimalDegrees-27.46758°, 153.02789°
DecimalDegreesWithHemisphere27.46758° S, 153.02789° E
DegreesMinutes-27° 28.054', 153° 1.673'
DegreesMinutesWithHemisphere27° 28.054 S', 153° 1.673' E
DegreesMinutesSeconds-27° 28' 3.2", 153° 1' 40.4"
DegreesMinutesSecondsWithHemisphere27° 28' 3.2" S, 153° 1' 40.4" E

CoordinateType QWhereaboutsCoordinate::type () const

Returns the type of this coordinate.

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

Assigns other to this coordinate and returns a reference to this coordinate.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 65
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Labs au hasard

Logo

Construire l'avenir : (ré-)introduction aux composants de Qt Quick

Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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 qtextended4.4
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