The QGeoMapData class are used as a bridge between QGraphicsGeoMap and QGeoMappingManager. More...
#include <QGeoMapData>
Inherits: QObject.
Inherited by: QGeoTiledMapData.
This class was introduced in Qt Mobility 1.1.
|
|
QGeoMapData ( QGeoMappingManagerEngine * engine ) | |
virtual | ~QGeoMapData () |
void | addMapObject ( QGeoMapObject * mapObject ) |
void | addMapOverlay ( QGeoMapOverlay * overlay ) |
qreal | bearing () const |
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 |
qreal | maximumTilt () const |
qreal | minimumTilt () 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 |
void | setBearing ( qreal bearing ) |
virtual void | setCenter ( const QGeoCoordinate & center ) |
virtual void | setConnectivityMode ( QGraphicsGeoMap::ConnectivityMode connectivityMode ) |
virtual void | setMapType ( QGraphicsGeoMap::MapType mapType ) |
void | setTilt ( qreal tilt ) |
virtual void | setWindowSize ( const QSizeF & size ) |
virtual void | setZoomLevel ( qreal zoomLevel ) |
bool | supportsBearing () const |
bool | supportsTilting () const |
qreal | tilt () const |
virtual QGeoBoundingBox | viewport () const = 0 |
virtual QSizeF | windowSize () const |
virtual qreal | zoomLevel () const |
void | bearingChanged ( qreal bearing ) |
void | centerChanged ( const QGeoCoordinate & coordinate ) |
void | connectivityModeChanged ( QGraphicsGeoMap::ConnectivityMode connectivityMode ) |
void | mapTypeChanged ( QGraphicsGeoMap::MapType mapType ) |
void | tiltChanged ( qreal tilt ) |
void | updateMapDisplay ( const QRectF & target = QRectF() ) |
void | windowSizeChanged ( const QSizeF & windowSize ) |
void | zoomLevelChanged ( qreal zoomLevel ) |
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 ) |
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.
Returns the current bearing of the map.
Value in degrees in the range of 0-360. 0 being equivalent to 0 degrees from north.
This property was introduced in Qt Mobility 1.2.
Access functions:
qreal | bearing () const |
void | setBearing ( qreal bearing ) |
Notifier signal:
void | bearingChanged ( qreal bearing ) |
Returns the coordinate of the point in the center of the map viewport.
This property was introduced in Qt Mobility 1.1.
Access functions:
virtual QGeoCoordinate | center () const |
virtual void | setCenter ( const QGeoCoordinate & center ) |
Notifier signal:
void | centerChanged ( const QGeoCoordinate & coordinate ) |
Returns the connectivity mode for this map.
This property was introduced in Qt Mobility 1.1.
Access functions:
virtual QGraphicsGeoMap::ConnectivityMode | connectivityMode () const |
virtual void | setConnectivityMode ( QGraphicsGeoMap::ConnectivityMode connectivityMode ) |
Notifier signal:
void | connectivityModeChanged ( QGraphicsGeoMap::ConnectivityMode connectivityMode ) |
Returns the type of map data which is being displayed.
This property was introduced in Qt Mobility 1.1.
Access functions:
virtual QGraphicsGeoMap::MapType | mapType () const |
virtual void | setMapType ( QGraphicsGeoMap::MapType mapType ) |
Notifier signal:
void | mapTypeChanged ( QGraphicsGeoMap::MapType mapType ) |
Returns maximum tilt supported by this engine.
This property was introduced in Qt Mobility 1.2.
Access functions:
qreal | maximumTilt () const |
Returns minimum tilt supported by this engine.
This property was introduced in Qt Mobility 1.2.
Access functions:
qreal | minimumTilt () const |
Returns whether bearing is supported by this engine.
This property was introduced in Qt Mobility 1.2.
Access functions:
bool | supportsBearing () const |
Returns whether tilting is supported by this engine.
This property was introduced in Qt Mobility 1.2.
Access functions:
bool | supportsTilting () const |
Returns the current tilt of the map.
Value in degrees where 0 is equivalent to 90 degrees between view and earth's surface i.e. looking straight down to earth.
This property was introduced in Qt Mobility 1.2.
Access functions:
qreal | tilt () const |
void | setTilt ( qreal tilt ) |
Notifier signal:
void | tiltChanged ( qreal tilt ) |
Returns the size of the map viewport.
The size will be adjusted by the associated QGraphicsGeoMap as it resizes.
This property was introduced in Qt Mobility 1.1.
Access functions:
virtual QSizeF | windowSize () const |
virtual void | setWindowSize ( const QSizeF & size ) |
Notifier signal:
void | windowSizeChanged ( const QSizeF & windowSize ) |
Returns the zoom level of the map.
Larger values of the zoom level correspond to more detailed views of the map.
This property was introduced in Qt Mobility 1.1.
Access functions:
virtual qreal | zoomLevel () const |
virtual void | setZoomLevel ( qreal zoomLevel ) |
Notifier signal:
void | zoomLevelChanged ( qreal zoomLevel ) |
Constructs a new map data object, which makes use of the functionality provided by engine.
Destroys this map data object.
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.
This function was introduced in Qt Mobility 1.1.
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.
This function was introduced in Qt Mobility 1.1.
This signal is emitted when the bearing of the map has changed.
The new value is bearing.
This function was introduced in Qt Mobility 1.2.
This signal is emitted when the center of the map has changed.
The new value is coordinate.
This function was introduced in Qt Mobility 1.1.
Clears the map objects associated with this map.
The map objects will be deleted.
This function was introduced in Qt Mobility 1.1.
Clears the map overlays associated with this map.
The map overlays will be deleted.
This function was introduced in Qt Mobility 1.1.
This signal is emitted when the connectivity mode used to fetch the map data has changed.
The new value is connectivityMode.
This function was introduced in Qt Mobility 1.1.
Returns the QGeoMapObject which acts as the parent to all QGeoMapObject instances which are added to the map by the user.
This function was introduced in Qt Mobility 1.1.
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.
This function was introduced in Qt Mobility 1.1.
Creates a QGeoMapObjectInfo instance which implements the behaviours o the map object object which are specific to this QGeoMapData.
The default implementation returns 0.
This function was introduced in Qt Mobility 1.1.
Returns the mapping engine that this map data object is associated with.
This function was introduced in Qt Mobility 1.1.
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.
This function was introduced in Qt Mobility 1.1.
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 overriding function.
This function was introduced in Qt Mobility 1.1.
Returns the map objects associated with this map.
This function was introduced in Qt Mobility 1.1.
Returns the list of visible map objects managed by this map which contain the point screenPosition within their boundaries.
This function was introduced in Qt Mobility 1.1.
Returns the list of visible map objects managed by this map which are displayed at least partially within the on screen rectangle screenRect.
This function was introduced in Qt Mobility 1.1.
Returns the list of visible map objects manager by this widget which are displayed at least partially within the viewport of the map.
This function was introduced in Qt Mobility 1.1.
Returns the map overlays associated with this map.
This function was introduced in Qt Mobility 1.1.
This signal is emitted when the type of the map has changes.
The value is mapType.
This function was introduced in Qt Mobility 1.1.
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().
This function was introduced in Qt Mobility 1.1.
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.
This function was introduced in Qt Mobility 1.1.
Paints the map objects on painter, using the options option.
The default implementation makes use of the coordinateToScreenPosition implemented by the subclass to perform object positioning and rendering.
This implementation should suffice for most common use cases, and supports the full range of coordinate systems and transforms available to a QGeoMapObject.
This function was introduced in Qt Mobility 1.1.
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.
This function was introduced in Qt Mobility 1.1.
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.
This function was introduced in Qt Mobility 1.1.
Removes mapObject from the list of map objects managed by this map. The map will release ownership of the mapObject.
This function was introduced in Qt Mobility 1.1.
Removes overlay from the list of map overlays associated with this map.
The map will release ownership of overlay.
This function was introduced in Qt Mobility 1.1.
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.
This function was introduced in Qt Mobility 1.1.
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 true 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.
This function was introduced in Qt Mobility 1.1.
This signal is emitted when the tilt of the map has changed.
The new value is tilt.
This function was introduced in Qt Mobility 1.2.
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.
This function was introduced in Qt Mobility 1.1.
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.
This function was introduced in Qt Mobility 1.1.
This signal is emitted when the size of the window which contains the map has changed.
The new value is windowSize.
This function was introduced in Qt Mobility 1.1.
This signal is emitted when the zoom level of the map has changed.
The new value is zoomLevel.
This function was introduced in Qt Mobility 1.1.
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.