QGeoMapData Class Reference
The QGeoMapData class are used as a bridge between QGeoMapWidget and QGeoMappingManager. More...
#include <QGeoMapData>
Public Functions
Protected Functions
Detailed Description
The QGeoMapData class are used as a bridge between QGeoMapWidget and QGeoMappingManager.
Instances of QGeoMapData are created with QGeoMappingManager::createMapData(), and are used internally by QGeoMappingWidget 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 overriden. If the screen position to coordinate tranformations are expensive then overriding these functions may allow optimizations based on caching parts of the geometry information.
Member Function Documentation
Constructs a new map data object, which stores the map data required by widget and makes use of the functionality provided by engine.
QGeoMapData::~QGeoMapData () [virtual]
Destroys this map data object.
void QGeoMapData::addMapObject ( QGeoMapObject * mapObject ) [virtual]
Adds mapObject to the list of map objects managed by this map. The map will take ownership of the mapObject.
QGeoCoordinate QGeoMapData::center () const [virtual]
Returns the coordinate of the point in the center of the map viewport.
See also setCenter().
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.
Returns the mapping engine that this map data object is associated with.
void QGeoMapData::imageChanged ( const QRectF & updateRect = QRectF() )
bool QGeoMapData::imageChangesTriggerUpdates () const
Returns whether changes to the map image will case widget() to update.
See also setImageChangesTriggerUpdates().
QPixmap & QGeoMapData::mapImage ()
Returns the image that will be displayed in the viewport of widget().
See also setMapImage().
QList<QGeoMapObject *> QGeoMapData::mapObjects () [virtual]
Returns the list of map objects managed by this map.
QList<QGeoMapObject *> QGeoMapData::mapObjectsAtScreenPosition ( const QPointF & screenPosition ) [virtual]
Returns the list of map objects managed by this map which are visible and contain the point screenPosition within their boundaries.
QList<QGeoMapObject *> QGeoMapData::mapObjectsInScreenRect ( const QRectF & screenRect ) [virtual]
Returns the list of map objects managed by this map which are visible and which are displayed at least partially within the on screen rectangle screenRect.
QPixmap QGeoMapData::mapObjectsOverlay () [pure virtual]
Returns the type of map data which is being displayed.
See also setMapType().
void QGeoMapData::pan ( int dx, int dy ) [virtual]
Pans the map view dx pixels in the x direction and dy pixels in they 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.
void QGeoMapData::removeMapObject ( QGeoMapObject * mapObject ) [virtual]
Removes mapObject from the list of map objects managed by this map. The map will release ownership of the mapObject.
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::setCenter ( const QGeoCoordinate & center ) [virtual]
Centers the map viewport on the coordinate center.
See also center().
void QGeoMapData::setImageChangesTriggerUpdates ( bool trigger )
Sets whether changes to the map image will cause widget() to update to trigger.
See also imageChangesTriggerUpdates().
void QGeoMapData::setMapImage ( const QPixmap & mapImage )
Sets the image that will be displayed in the viewport of widget() to mapImage.
See also mapImage().
void QGeoMapData::setMapType ( QGeoMapWidget::MapType mapType ) [virtual]
Changes the type of map data to display to mapType.
See also mapType().
void QGeoMapData::setViewportSize ( const QSizeF & size ) [virtual]
Sets the size of the map viewport to size.
The size will be adjusted by the associated QGeoMapWidget as it resizes.
See also viewportSize().
void QGeoMapData::setZoomLevel ( qreal zoomLevel ) [virtual]
Sets the zoom level of the map to zoomLevel.
Larger values of the zoom level correspond to more detailed views of the map.
If zoomLevel is less than minimumZoomLevel() then minimumZoomLevel() will be used, and if zoomLevel is larger than maximumZoomLevel() then maximumZoomLevel() will be used.
See also zoomLevel().
void QGeoMapData::startPanning () [virtual]
void QGeoMapData::stopPanning () [virtual]
QSizeF QGeoMapData::viewportSize () const [virtual]
Returns the size of the map viewport.
The size will be adjusted by the associated QGeoMapWidget as it resizes.
See also setViewportSize().
QList<QGeoMapObject *> QGeoMapData::visibleMapObjects () [virtual]
Returns the list of map objects managed by this map which are currently visible and at least partially within the viewport of the map.
QGeoMapWidget * QGeoMapData::widget () const [protected]
Returns the widget that this map data object is associated with.
qreal QGeoMapData::zoomLevel () const [virtual]
Returns the zoom level of the map.
Larger values of the zoom level correspond to more detailed views of the map.
See also setZoomLevel().