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  · 

QGeoMapData Class Reference

The QGeoMapData class are used as a bridge between QGraphicsGeoMap and QGeoMappingManager. More...

 #include <QGeoMapData>

Inherits QObject.

Inherited by QGeoTiledMapData.

Properties

  • 1 property inherited from QObject

Public Functions

QGeoMapData ( QGeoMappingManagerEngine * engine )
virtual ~QGeoMapData ()
void addMapObject ( QGeoMapObject * mapObject )
void addMapOverlay ( QGeoMapOverlay * overlay )
virtual QGeoCoordinate center () const
void clearMapObjects ()
void clearMapOverlays ()
virtual QGraphicsGeoMap::ConnectivityMode connectivityMode () const
virtual QPointF coordinateToScreenPosition ( const QGeoCoordinate & coordinate ) const = 0
virtual void fitInViewport ( const QGeoBoundingBox & bounds, bool preserveViewportCenter = false ) = 0
virtual void init ()
QList<QGeoMapObject *> mapObjects () const
virtual QList<QGeoMapObject *> mapObjectsAtScreenPosition ( const QPointF & screenPosition ) const
virtual QList<QGeoMapObject *> mapObjectsInScreenRect ( const QRectF & screenRect ) const
virtual QList<QGeoMapObject *> mapObjectsInViewport () const
QList<QGeoMapOverlay *> mapOverlays () const
virtual QGraphicsGeoMap::MapType mapType () const
virtual void paint ( QPainter * painter, const QStyleOptionGraphicsItem * option )
virtual void pan ( int dx, int dy )
void removeMapObject ( QGeoMapObject * mapObject )
void removeMapOverlay ( QGeoMapOverlay * overlay )
virtual QGeoCoordinate screenPositionToCoordinate ( const QPointF & screenPosition ) const = 0
virtual void setCenter ( const QGeoCoordinate & center )
virtual void setConnectivityMode ( QGraphicsGeoMap::ConnectivityMode connectivityMode )
virtual void setMapType ( QGraphicsGeoMap::MapType mapType )
virtual void setWindowSize ( const QSizeF & size )
virtual void setZoomLevel ( qreal zoomLevel )
virtual QGeoBoundingBox viewport () const = 0
virtual QSizeF windowSize () const
virtual qreal zoomLevel () const
  • 29 public functions inherited from QObject

Signals

void centerChanged ( const QGeoCoordinate & coordinate )
void connectivityModeChanged ( QGraphicsGeoMap::ConnectivityMode connectivityMode )
void mapTypeChanged ( QGraphicsGeoMap::MapType mapType )
void updateMapDisplay ( const QRectF & target = QRectF() )
void windowSizeChanged ( const QSizeF & windowSize )
void zoomLevelChanged ( qreal zoomLevel )

Protected Functions

QGeoMapObject * containerObject ()
virtual QGeoMapObjectInfo * createMapObjectInfo ( QGeoMapObject * object )
QGeoMappingManagerEngine * engine () const
virtual void paintMap ( QPainter * painter, const QStyleOptionGraphicsItem * option )
virtual void paintObjects ( QPainter * painter, const QStyleOptionGraphicsItem * option )
virtual void paintProviderNotices ( QPainter * painter, const QStyleOptionGraphicsItem * option )
void setBlockPropertyChangeSignals ( bool block )
  • 7 protected functions inherited from QObject

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 4 static public members inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QGeoMapData class are used as a bridge between QGraphicsGeoMap and QGeoMappingManager.

Instances of QGeoMapData are created with QGeoMappingManager::createMapData(), and are used internally by QGraphicsGeoMap to manage the state of the map and the associated QGeoMapObject instances.

Plugin implementers will need to provide implementations of coordinateToScreenPosition(const QGeoCoordinate &coordinate) and QGeoCoordinate screenPositionToCoordinate(const QPointF &screenPosition).

The other virtual functions can be overridden. If the screen position to coordinate tranformations are expensive then overriding these functions may allow optimizations based on caching parts of the geometry information.

Subclasses should override createMapObjectInfo() so that QGeoMapObjectInfo instances will be created for each QGeoMapObject type in order to provide the QGeoMapData subclass specific behaviours for the map objects.

Property Documentation

center : QGeoCoordinate

Returns the coordinate of the point in the center of the map viewport.

Access functions:

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

Notifier signal:

void centerChanged ( const QGeoCoordinate & coordinate )

connectivityMode : QGraphicsGeoMap::ConnectivityMode

Returns the connectivity mode for this map.

Access functions:

virtual QGraphicsGeoMap::ConnectivityMode connectivityMode () const
virtual void setConnectivityMode ( QGraphicsGeoMap::ConnectivityMode connectivityMode )

Notifier signal:

void connectivityModeChanged ( QGraphicsGeoMap::ConnectivityMode connectivityMode )

mapType : QGraphicsGeoMap::MapType

Returns the type of map data which is being displayed.

Access functions:

virtual QGraphicsGeoMap::MapType mapType () const
virtual void setMapType ( QGraphicsGeoMap::MapType mapType )

Notifier signal:

void mapTypeChanged ( QGraphicsGeoMap::MapType mapType )

windowSize : QSizeF

Returns the size of the map viewport.

The size will be adjusted by the associated QGraphicsGeoMap as it resizes.

Access functions:

virtual QSizeF windowSize () const
virtual void setWindowSize ( const QSizeF & size )

Notifier signal:

void windowSizeChanged ( const QSizeF & windowSize )

zoomLevel : qreal

Returns the zoom level of the map.

Larger values of the zoom level correspond to more detailed views of the map.

Access functions:

virtual qreal zoomLevel () const
virtual void setZoomLevel ( qreal zoomLevel )

Notifier signal:

void zoomLevelChanged ( qreal zoomLevel )

Member Function Documentation

QGeoMapData::QGeoMapData ( QGeoMappingManagerEngine * engine )

Constructs a new map data object, which makes use of the functionality provided by engine.

QGeoMapData::~QGeoMapData () [virtual]

Destroys this map data object.

void QGeoMapData::addMapObject ( QGeoMapObject * mapObject )

Adds mapObject to the list of map objects managed by this map.

The children objects are drawn in order of the QGeoMapObject::zValue() value. Children objects having the same z value will be drawn in the order they were added.

The map will take ownership of the mapObject.

void QGeoMapData::addMapOverlay ( QGeoMapOverlay * overlay )

Adds overlay to the list of map overlays associated with this map.

The overlays will be drawn in the order in which they were added.

The map will take ownership of overlay.

void QGeoMapData::centerChanged ( const QGeoCoordinate & coordinate ) [signal]

This signal is emitted when the center of the map has changed.

The new value is coordinate.

void QGeoMapData::clearMapObjects ()

Clears the map objects associated with this map.

The map objects will be deleted.

void QGeoMapData::clearMapOverlays ()

Clears the map overlays associated with this map.

The map overlays will be deleted.

void QGeoMapData::connectivityModeChanged ( QGraphicsGeoMap::ConnectivityMode connectivityMode ) [signal]

This signal is emitted when the connectivity mode used to fetch the map data has changed.

The new value is connectivityMode.

QGeoMapObject * QGeoMapData::containerObject () [protected]

Returns the QGeoMapObject which acts as the parent to all QGeoMapObject instances which are added to the map by the user.

QPointF QGeoMapData::coordinateToScreenPosition ( const QGeoCoordinate & coordinate ) const [pure virtual]

Returns the position on the screen at which coordinate is displayed.

An invalid QPointF will be returned if coordinate is invalid or is not within the current viewport.

QGeoMapObjectInfo * QGeoMapData::createMapObjectInfo ( QGeoMapObject * object ) [virtual protected]

Creates a QGeoMapObjectInfo instance which implements the behaviours of the map object object which are specific to this QGeoMapData.

The default implementation returns 0.

QGeoMappingManagerEngine * QGeoMapData::engine () const [protected]

Returns the mapping engine that this map data object is associated with.

void QGeoMapData::fitInViewport ( const QGeoBoundingBox & bounds, bool preserveViewportCenter = false ) [pure virtual]

Attempts to fit the bounding box bounds into the viewport of the map.

This method will change the zoom level to the maximum zoom level such that all of bounds is visible within the resulting viewport.

If preserveViewportCenter is false the map will be centered on the bounding box bounds before the zoom level is changed, otherwise the center of the map will not be changed.

void QGeoMapData::init () [virtual]

This function is run after the QGeoMapData instance has been constructed.

Any subclasses which override this function should make sure that QGeoMapData::init() is called within the body of the overridding function.

QList<QGeoMapObject *> QGeoMapData::mapObjects () const

Returns the map objects associated with this map.

QList<QGeoMapObject *> QGeoMapData::mapObjectsAtScreenPosition ( const QPointF & screenPosition ) const [virtual]

Returns the list of visible map objects managed by this map which contain the point screenPosition within their boundaries.

QList<QGeoMapObject *> QGeoMapData::mapObjectsInScreenRect ( const QRectF & screenRect ) const [virtual]

Returns the list of visible map objects managed by this map which are displayed at least partially within the on screen rectangle screenRect.

QList<QGeoMapObject *> QGeoMapData::mapObjectsInViewport () const [virtual]

Returns the list of visible map objects manager by this widget which are displayed at least partially within the viewport of the map.

QList<QGeoMapOverlay *> QGeoMapData::mapOverlays () const

Returns the map overlays associated with this map.

void QGeoMapData::mapTypeChanged ( QGraphicsGeoMap::MapType mapType ) [signal]

This signal is emitted when the type of the map has changes.

The value is mapType.

void QGeoMapData::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option ) [virtual]

Paints the map and everything associated with it on painter, using the options option.

This will paint the map with paintMap(), then the map overlays with QGeoMapOverlay::paint(), then the map objects with paintObjects(), and finally paintProviderNotices().

void QGeoMapData::paintMap ( QPainter * painter, const QStyleOptionGraphicsItem * option ) [virtual protected]

Paints the map on painter, using the options option.

The map overlays, map objects and the provider notices (such as copyright and powered by notices) are painted in separate methods, which are combined in the paint() method.

The default implementation does not paint anything.

void QGeoMapData::paintObjects ( QPainter * painter, const QStyleOptionGraphicsItem * option ) [virtual protected]

Paints the map objects on painter, using the options option.

The default implementation does not paint anything.

void QGeoMapData::paintProviderNotices ( QPainter * painter, const QStyleOptionGraphicsItem * option ) [virtual protected]

Paints the provider notices on painter, using the options option.

The provider notices are things like the copyright and powered by notices.

The provider may not want the client developers to be able to move the notices from their standard positions and so we have not provided API support for specifying the position of the notices at this time.

If support for hinting at the position of the notices is to be provided by plugin parameters, the suggested parameter keys are "mapping.notices.copyright.alignment" and "mapping.notices.poweredby.alignment", with type Qt::Alignment.

The default implementation does not paint anything.

void QGeoMapData::pan ( int dx, int dy ) [virtual]

Pans the map view dx pixels in the x direction and dy pixels in the y direction.

The x and y axes are specified in Graphics View Framework coordinates. By default this will mean that positive values of dx move the viewed area to the right and that positive values of dy move the viewed area down.

Subclasses should call QGeoMapData::setCenter() when the pan has completed.

void QGeoMapData::removeMapObject ( QGeoMapObject * mapObject )

Removes mapObject from the list of map objects managed by this map. The map will release ownership of the mapObject.

void QGeoMapData::removeMapOverlay ( QGeoMapOverlay * overlay )

Removes overlay from the list of map overlays associated with this map.

The map will release ownership of overlay.

QGeoCoordinate QGeoMapData::screenPositionToCoordinate ( const QPointF & screenPosition ) const [pure virtual]

Returns the coordinate corresponding to the point in the viewport at screenPosition.

An invalid QGeoCoordinate will be returned if screenPosition is invalid or is not within the current viewport.

void QGeoMapData::setBlockPropertyChangeSignals ( bool block ) [protected]

Sets whether changes to properties will trigger their corresponding signals to block.

By default the QGeoMapData implementations of the property functions are used which cause the property notification signals to be emitted immediately.

Calling this function with block set to false will prevent these signals from being called, which will allow a subclass to defer the emission of the signal until a later time.

If this function needs to be called it should be used as soon as possible, preferably in the constructor of the QGeoMapData subclass.

void QGeoMapData::updateMapDisplay ( const QRectF & target = QRectF() ) [signal]

This signal is emitted when the region target of the window which contains the map needs to be updated.

If target is empty then the entire map will be updated.

QGeoBoundingBox QGeoMapData::viewport () const [pure virtual]

Returns a bounding box corresponding to the physical area displayed in the viewport of the map.

The bounding box which is returned is defined by the upper left and lower right corners of the visible area of the map.

void QGeoMapData::windowSizeChanged ( const QSizeF & windowSize ) [signal]

This signal is emitted when the size of the window which contains the map has changed.

The new value is windowSize.

void QGeoMapData::zoomLevelChanged ( qreal zoomLevel ) [signal]

This signal is emitted when the zoom level of the map has changed.

The new value is zoomLevel.

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); })();
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 54
  2. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  3. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  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 Developer Network au hasard

Logo

Combiner licence, à propos et fermer d'une dernière manière

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. 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 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