Qt Mobility Reference Documentation

QGeoMapObject Class Reference

The QGeoMapObject class is graphical item for display in QGraphicsGeoMap instancse, that is specified in terms of coordinates and distances. More...

 #include <QGeoMapObject>

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


Public Types

enum Type { ContainerType, RectangleType, CircleType, PolylineType, ..., RouteType }

Properties


Public Functions

QGeoMapObject ( QGeoMapObject * parent = 0 )
virtual ~QGeoMapObject ()
void addChildObject ( QGeoMapObject * childObject )
QGeoBoundingBox boundingBox () const
QList<QGeoMapObject *> childObjects () const
void clearChildObjects ()
bool contains ( const QGeoCoordinate & coordinate ) const
bool isSelected () const
bool isVisible () const
QGeoMapObject * parentObject () const
void removeChildObject ( QGeoMapObject * childObject )
void setSelected ( bool selected )
void setVisible ( bool visible )
void setZValue ( int zValue )
Type type () const
int zValue () const

Signals

void selectedChanged ( bool selected )
void visibleChanged ( bool visible )
void zValueChanged ( int zValue )

Detailed Description

The QGeoMapObject class is graphical item for display in QGraphicsGeoMap instancse, that is specified in terms of coordinates and distances.

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


Member Type Documentation

enum QGeoMapObject::Type

Describes the type of a map object.

ConstantValueDescription
QGeoMapObject::ContainerType0A basic QGeoMapObject.
QGeoMapObject::RectangleType1A QGeoMapObject used to display a rectangular region.
QGeoMapObject::CircleType2A QGeoMapObject used to display a circular region.
QGeoMapObject::PolylineType3A QGeoMapObject used to display a multi-segment line.
QGeoMapObject::PolygonType4A QGeoMapObject used to display a polygonal region.
QGeoMapObject::PixmapType5A QGeoMapObject used to display a pixmap on a map.
QGeoMapObject::TextType6A QGeoMapObject used to display text on a map
QGeoMapObject::RouteType7A QGeoMapObject used to display a route.

Property Documentation

selected : bool

This property holds this property holds whether the map object is selected.

Access functions:

bool isSelected () const
void setSelected ( bool selected )

Notifier signal:

void selectedChanged ( bool selected )

visible : bool

This property holds this property holds whether the map object is visible.

If this map object is not visible then none of the childObjects() will be displayed either.

Access functions:

bool isVisible () const
void setVisible ( bool visible )

Notifier signal:

void visibleChanged ( bool visible )

zValue : int

This property holds 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.

Access functions:

int zValue () const
void setZValue ( int zValue )

Notifier signal:

void zValueChanged ( int zValue )

Member Function Documentation

QGeoMapObject::QGeoMapObject ( QGeoMapObject * parent = 0 )

Constructs a new map object with the specified parent.

QGeoMapObject::~QGeoMapObject () [virtual]

Destroys this map object.

void QGeoMapObject::addChildObject ( QGeoMapObject * childObject )

Adds childObject to the list of children of this map object.

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 object will take ownership of childObject.

QGeoBoundingBox QGeoMapObject::boundingBox () const

Returns a bounding box which contains this map object.

If this map object has children, the bounding box will be large enough to contain both this map object and all of its children.

QList<QGeoMapObject *> QGeoMapObject::childObjects () const

Returns the children of this object.

void QGeoMapObject::clearChildObjects ()

Clears the children of this object.

The child objects will be deleted.

bool QGeoMapObject::contains ( const QGeoCoordinate & coordinate ) const

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

If this map object has children, this function will return whether coordinate is contained within the boundary of this map object or within the boundary of any of its children.

QGeoMapObject * QGeoMapObject::parentObject () const

Returns the parent of this map object.

Returns 0 if this map object has no parent.

void QGeoMapObject::removeChildObject ( QGeoMapObject * childObject )

Removes childObject from the list of children of this map object.

The map object will release ownership of childObject.

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

Type QGeoMapObject::type () const

Returns the type of this map object.

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

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

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.