MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

QGeoMapObject Class Reference

The QGeoMapObject class is a graphical item to be displayed on a map. More...

 #include <QGeoMapObject>

Inherits: QObject.

Inherited by: QGeoMapCircleObject, QGeoMapCustomObject, QGeoMapGroupObject, QGeoMapPixmapObject, QGeoMapPolygonObject, QGeoMapPolylineObject, QGeoMapRectangleObject, QGeoMapRouteObject, and QGeoMapTextObject.

This class was introduced in Qt Mobility 1.1.

Public Types

enum CoordinateUnit { PixelUnit, MeterUnit, RelativeArcSecondUnit, AbsoluteArcSecondUnit }
enum TransformType { BilinearTransform, ExactTransform }
enum Type { NullType, GroupType, RectangleType, CircleType, ..., CustomType }

Properties

  • 1 property inherited from QObject

Public Functions

QGeoMapObject ( QGeoMapData * mapData = 0 )
virtual ~QGeoMapObject ()
virtual QGeoBoundingBox boundingBox () const
virtual bool contains ( const QGeoCoordinate & coordinate ) const
QGeoMapObjectInfo * info () const
bool isSelected () const
bool isVisible () const
virtual QGeoMapData * mapData () const
QGeoCoordinate origin () const
virtual void setMapData ( QGeoMapData * mapData )
void setSelected ( bool selected )
void setVisible ( bool visible )
void setZValue ( int zValue )
TransformType transformType () const
virtual Type type () const
CoordinateUnit units () const
int zValue () const
  • 29 public functions inherited from QObject

Signals

void originChanged ( QGeoCoordinate origin )
void selectedChanged ( bool selected )
void transformTypeChanged ( QGeoMapObject::TransformType transformType )
void unitsChanged ( QGeoMapObject::CoordinateUnit units )
void visibleChanged ( bool visible )
void zValueChanged ( int zValue )

Protected Functions

void setOrigin ( const QGeoCoordinate & origin )
void setTransformType ( const TransformType & type )
void setUnits ( const CoordinateUnit & unit )
  • 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 QGeoMapObject class is a graphical item to be displayed on a map.

QGeoMapObject is the base class used to display graphical items on a map.

Subclasses of QGeoMapObject exist in order to simplify the task of creating and managing map objects of various kinds.

QGeoMapCustomObject is the most generic of these objects in that it allows QGraphicsItems to be added to a map, however as not all mapping plugins use the Qt Graphics View framework so clients should use QGraphicsGeoMap::supportsCustomMapObjects() before using QGeoMapCustomObject.

QGeoMapObject instances can also be grouped into heirarchies in order to simplify the process of creating compound objects and managing groups of objects (see QGeoMapGroupObject)

Member Type Documentation

enum QGeoMapObject::CoordinateUnit

Describes the units of measurement used for a map object's graphics item.

Constant Value Description
QGeoMapObject::PixelUnit 0 Units are in pixels on the screen. Pixel coordinate (0,0) is translated to the origin coordinate.
QGeoMapObject::MeterUnit 1 Units are in meters on the ground -- a local Transverse Mercator coordinate system (on the WGS84 ellipsoid) is used for translation, centered on the origin coordinate.
QGeoMapObject::RelativeArcSecondUnit 2 Units are in arc seconds relative to the origin coordinate (along the WGS84 ellipsoid).
QGeoMapObject::AbsoluteArcSecondUnit 3 Units are in arc seconds on WGS84, origin ignored.

This enum was introduced or modified in Qt Mobility 1.2.

enum QGeoMapObject::TransformType

Describes the type of transformation applied to change this object's coordinate system into screen coordinates.

Constant Value Description
QGeoMapObject::BilinearTransform 0 This object's bounding box is taken, and transformed at each of its corners into screen coordinates. A bilinear interpolation is then used to draw the rest of the object's GraphicsItem.
QGeoMapObject::ExactTransform 1 Individual key points on the object are transformed and the GraphicsItem is constructed in direct pixel coordinates. This is only available for certain subclasses, depending on the implementation of QGeoMapData used.

This enum was introduced or modified in Qt Mobility 1.2.

enum QGeoMapObject::Type

Describes the type of a map object.

Constant Value Description
QGeoMapObject::NullType 0 An empty QGeoMapObject.
QGeoMapObject::GroupType 1 A QGeoMapObject used to organize other map objects into groups.
QGeoMapObject::RectangleType 2 A QGeoMapObject used to display a rectangular region.
QGeoMapObject::CircleType 3 A QGeoMapObject used to display a circular region.
QGeoMapObject::PolylineType 4 A QGeoMapObject used to display a multi-segment line.
QGeoMapObject::PolygonType 5 A QGeoMapObject used to display a polygonal region.
QGeoMapObject::PixmapType 6 A QGeoMapObject used to display a pixmap on a map.
QGeoMapObject::TextType 7 A QGeoMapObject used to display text on a map
QGeoMapObject::RouteType 8 A QGeoMapObject used to display a route.
QGeoMapObject::CustomType 9 A QGeoMapObject displaying a custom GraphicsItem.

Property Documentation

origin : const QGeoCoordinate

This property holds the origin of the object's coordinate system.

How the origin coordinate is used depends on the selected coordinate system, see QGeoMapObject::TransformType for more details.

This property was introduced in Qt Mobility 1.2.

Access functions:

QGeoCoordinate origin () const

Notifier signal:

void originChanged ( QGeoCoordinate origin )

selected : bool

This property holds whether the map object is selected.

This property was introduced in Qt Mobility 1.1.

Access functions:

bool isSelected () const
void setSelected ( bool selected )

Notifier signal:

void selectedChanged ( bool selected )

transformType : const TransformType

This property holds the transformation type used to draw the object.

This property was introduced in Qt Mobility 1.2.

Access functions:

TransformType transformType () const

Notifier signal:

void transformTypeChanged ( QGeoMapObject::TransformType transformType )

See also QGeoMapObject::TransformType.

units : const CoordinateUnit

This property holds the units of measurement for the object.

This property was introduced in Qt Mobility 1.2.

Access functions:

CoordinateUnit units () const

Notifier signal:

void unitsChanged ( QGeoMapObject::CoordinateUnit units )

See also QGeoMapObject::CoordinateUnit.

visible : bool

This property holds whether the map object is visible.

This property was introduced in Qt Mobility 1.1.

Access functions:

bool isVisible () const
void setVisible ( bool visible )

Notifier signal:

void visibleChanged ( bool visible )

zValue : int

This property holds the z-value of the map object.

The z-value determines the order in which the objects are drawn on the screen. Objects with the same value will be drawn in the order that they were added to the map or map object.

This is the same behaviour as QGraphicsItem.

This property was introduced in Qt Mobility 1.1.

Access functions:

int zValue () const
void setZValue ( int zValue )

Notifier signal:

void zValueChanged ( int zValue )

Member Function Documentation

QGeoMapObject::QGeoMapObject ( QGeoMapData * mapData = 0 )

Constructs a new map object associated with mapData.

The object will be in pixel coordinates, with exact transform.

QGeoMapObject::~QGeoMapObject () [virtual]

Destroys this map object.

QGeoBoundingBox QGeoMapObject::boundingBox () const [virtual]

Returns a bounding box which contains this map object.

The default implementation requires the object to be added to a map before this function returns a valid bounding box.

This function was introduced in Qt Mobility 1.1.

bool QGeoMapObject::contains ( const QGeoCoordinate & coordinate ) const [virtual]

Returns whether coordinate is contained with the boundary of this map object.

The default implementation requires the object to be added to a map before this function is able to return true.

This function was introduced in Qt Mobility 1.1.

QGeoMapObjectInfo * QGeoMapObject::info () const

Returns the QGeoMapObjectInfo instance which implements the QGeoMapData specific behaviours of this map object.

This will mostly be useful when implementing custom QGeoMapData subclasses.

This function was introduced in Qt Mobility 1.1.

QGeoMapData * QGeoMapObject::mapData () const [virtual]

Returns the QGeoMapData instance associated with this object.

Will return 0 if not QGeoMapData instance has been set.

This function was introduced in Qt Mobility 1.1.

See also setMapData().

void QGeoMapObject::originChanged ( QGeoCoordinate origin ) [signal]

This signal is emitted when the origin of the map object has changed.

The new value is origin.

This function was introduced in Qt Mobility 1.2.

void QGeoMapObject::selectedChanged ( bool selected ) [signal]

This signal is emitted when the selected state of the map object has changed.

The new vlaue is selected.

This function was introduced in Qt Mobility 1.1.

void QGeoMapObject::setMapData ( QGeoMapData * mapData ) [virtual]

Associates the QGeoMapData instance mapData with this map object.

This will create an appropriate QGeoMapObjectInfo instance for this QGeoMapObject and will connect the appropriate signals to it so that it can be kept up to date.

This function was introduced in Qt Mobility 1.1.

See also mapData().

void QGeoMapObject::setOrigin ( const QGeoCoordinate & origin ) [protected]

Sets the origin of the object to origin.

This function was introduced in Qt Mobility 1.2.

See also origin().

void QGeoMapObject::setTransformType ( const TransformType & type ) [protected]

Sets the transform type of the object to type.

This function was introduced in Qt Mobility 1.2.

See also transformType().

void QGeoMapObject::setUnits ( const CoordinateUnit & unit ) [protected]

Sets the coordinate units of the object to unit.

Note that setting this property will reset the transformType property to the default for the units given. For PixelUnit, this is ExactTransform, and for all others, BilinearTransform.

This function was introduced in Qt Mobility 1.2.

See also units().

void QGeoMapObject::transformTypeChanged ( QGeoMapObject::TransformType transformType ) [signal]

This signal is emitted when the transform type of the map object has changed.

The new value is transformType.

This function was introduced in Qt Mobility 1.2.

Type QGeoMapObject::type () const [virtual]

Returns the type of this map object.

This function was introduced in Qt Mobility 1.1.

void QGeoMapObject::unitsChanged ( QGeoMapObject::CoordinateUnit units ) [signal]

This signal is emitted when the coordinate units of the map object have changed.

The new value is units.

This function was introduced in Qt Mobility 1.2.

void QGeoMapObject::visibleChanged ( bool visible ) [signal]

This signal is emitted when the visible state of the map object has changed.

The new value is visible.

This function was introduced in Qt Mobility 1.1.

void QGeoMapObject::zValueChanged ( int zValue ) [signal]

This signal is emitted when the z value of the map object has changed.

The new value is zValue.

This function was introduced in Qt Mobility 1.1.