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.
enum | CoordinateUnit { PixelUnit, MeterUnit, RelativeArcSecondUnit, AbsoluteArcSecondUnit } |
enum | TransformType { BilinearTransform, ExactTransform } |
enum | Type { NullType, GroupType, RectangleType, CircleType, ..., CustomType } |
|
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 |
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 ) |
void | setOrigin ( const QGeoCoordinate & origin ) |
void | setTransformType ( const TransformType & type ) |
void | setUnits ( const CoordinateUnit & unit ) |
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)
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.
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.
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. |
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 ) |
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 ) |
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.
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.
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 ) |
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 ) |
Constructs a new map object associated with mapData.
The object will be in pixel coordinates, with exact transform.
Destroys this map object.
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.
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.
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.
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().
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.
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.
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().
Sets the origin of the object to origin.
This function was introduced in Qt Mobility 1.2.
See also origin().
Sets the transform type of the object to type.
This function was introduced in Qt Mobility 1.2.
See also transformType().
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().
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.
Returns the type of this map object.
This function was introduced in Qt Mobility 1.1.
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.
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.
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.