QML PositionSource ElementThe PositionSource element allows you to get information about your current position. More... Properties
SignalsMethodsDetailed DescriptionThe PositionSource element allows you to get information about your current position. You can receive information about things such as latitude, longitude, altitude, and speed. This element is part of the QtMobility.location 1.1 module. Support for location sources are platform dependant. When declaring a PositionSource element, a default PositionSource source shall be created. Supported positioning methods are held in positioningMethod. As a development convenience, one may also set data file as a source (NMEA format). Location updates are not necessarily started automatically upon element declaration, see start stop active and update. Here is very simple example QML to illustrate the usage: import Qt 4.7 import QtMobility.location 1.1 Rectangle { id: page width: 350 height: 350 PositionSource { id: positionSource updateInterval: 1000 active: true // nmeaSource: "nmealog.txt" } Column { Text {text: "<==== PositionSource ====>"} Text {text: "positioningMethod: " + printableMethod(positionSource.positioningMethod)} Text {text: "nmeaSource: " + positionSource.nmeaSource} Text {text: "updateInterval: " + positionSource.updateInterval} Text {text: "active: " + positionSource.active} Text {text: "<==== Position ====>"} Text {text: "latitude: " + positionSource.position.coordinate.latitude} Text {text: "longitude: " + positionSource.position.coordinate.longitude} Text {text: "altitude: " + positionSource.position.coordinate.altitude} Text {text: "speed: " + positionSource.position.speed} Text {text: "timestamp: " + positionSource.position.timestamp} Text {text: "altitudeValid: " + positionSource.position.altitudeValid} Text {text: "longitudeValid: " + positionSource.position.longitudeValid} Text {text: "latitudeValid: " + positionSource.position.latitudeValid} Text {text: "speedValid: " + positionSource.position.speedValid} } function printableMethod(method) { if (method == PositionSource.SatellitePositioningMethod) return "Satellite"; else if (method == PositionSource.NoPositioningMethod) return "Not available" else if (method == PositionSource.NonSatellitePositioningMethod) return "Non-satellite" else if (method == PositionSource.AllPositioningMethods) return "All/multiple" return "source error"; } } See also QGeoPositionInfoSource, QGeoPositionInfo, QNmeaPositionInfoSource, and QGeoCoordinate. Property DocumentationThis property holds the source for NMEA data (file). One purpose of this property is to be of development convenience. Setting this property will override any other position source. Currently only files local to the .qml -file are supported. Nmea source is created in simulation mode, meaning that the data and time information in the NMEA source data is used to provide positional updates at the rate at which the data was originally recorded. If nmeaSource has been set for a PositionSource element, there is no way to revert back to non-file sources. This documentation was introduced in Qt Mobility Mobility 1.2. This property holds the last known positional data. The Position element has different positional member variables, whose validity can be checked with appropriate validity functions (e.g. sometimes an update does not have speed or altitude data). However, whenever a positionChanged signal has been received, at least position::coordinate::latitude, position::coordinate::longitude, and position::timestamp can be assumed to be valid. This documentation was introduced in Qt Mobility Mobility 1.2. This property holds the supported positioning methods of the current source.
This documentation was introduced in Qt Mobility Mobility 1.2. This property holds the desired interval between updates (milliseconds). This documentation was introduced in Qt Mobility Mobility 1.2. See also QGeoPositionInfoSource::updateInterval(). Signal DocumentationThis signal is sent when a position update has been received from the location source. Upon receiving this signal, at least position::latitude, position::longitude, and position::timestamp members of the position have been updated. This documentation was introduced in Qt Mobility Mobility 1.2. See also updateInterval. Method DocumentationRequests updates from the location source. Uses updateInterval if set, default interval otherwise. If there is no source available, this method has no effect. This documentation was introduced in Qt Mobility Mobility 1.2. |
Publicité
Best OfActualités les plus luesSemaine
Mois
Année
![]()
![]() Le Qt Labs au hasard![]() Construire l'avenir : (ré-)introduction aux composants de Qt QuickLes 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 utilesContact
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 qtmobility-1.2 | |
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 ! |
Copyright © 2000-2012 - www.developpez.com