QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
QgsComposerMapItem Class Reference

An item which is drawn inside a QgsComposerMap, eg a grid or map overview. More...

#include <qgscomposermapitem.h>

Inheritance diagram for QgsComposerMapItem:
Inheritance graph
[legend]

Public Member Functions

 QgsComposerMapItem (const QString &name, QgsComposerMap *map)
 Constructor for QgsComposerMapItem.
virtual ~QgsComposerMapItem ()
virtual void draw (QPainter *painter)=0
 Draws the item on to a painter.
virtual bool writeXML (QDomElement &elem, QDomDocument &doc) const
 Stores map item state in DOM element.
virtual bool readXML (const QDomElement &itemElem, const QDomDocument &doc)
 Sets map item state from a DOM document.
virtual void setComposerMap (QgsComposerMap *map)
 Sets composer map for the item.
virtual const QgsComposerMapcomposerMap () const
 Get composer map for the item.
QString id () const
 Get the unique id for the map item.
virtual void setName (const QString &name)
 Sets the friendly display name for the item.
virtual QString name () const
 Get friendly display name for the item.
virtual void setEnabled (const bool enabled)
 Controls whether the item will be drawn.
virtual bool enabled () const
 Returns whether the item will be drawn.
virtual bool usesAdvancedEffects () const
 Returns true if the item is drawn using advanced effects, such as blend modes.
- Public Member Functions inherited from QgsComposerObject
 QgsComposerObject (QgsComposition *composition)
 Constructor.
virtual ~QgsComposerObject ()
const QgsCompositioncomposition () const
 Returns the composition the item is attached to.
QgsCompositioncomposition ()
QgsDataDefineddataDefinedProperty (const DataDefinedProperty property) const
 Returns a reference to the data defined settings for one of the item's data defined properties.
void setDataDefinedProperty (const DataDefinedProperty property, const bool active, const bool useExpression, const QString &expression, const QString &field)
 Sets parameters for a data defined property for the item.

Protected Attributes

QString mName
 Friendly display name.
QgsComposerMapmComposerMap
 Associated composer map.
QString mUuid
 Unique id.
bool mEnabled
 True if item is to be displayed on map.
- Protected Attributes inherited from QgsComposerObject
QgsCompositionmComposition
QMap
< QgsComposerObject::DataDefinedProperty,
QString > 
mDataDefinedNames
 Map of data defined properties for the item to string name to use when exporting item to xml.

Additional Inherited Members

- Public Types inherited from QgsComposerObject
enum  DataDefinedProperty {
  NoProperty = 0, AllProperties, TestProperty, PresetPaperSize,
  PaperWidth, PaperHeight, NumPages, PaperOrientation,
  PageNumber, PositionX, PositionY, ItemWidth,
  ItemHeight, ItemRotation, Transparency, BlendMode,
  ExcludeFromExports, MapRotation, MapScale, MapXMin,
  MapYMin, MapXMax, MapYMax, MapAtlasMargin,
  PictureSource, SourceUrl
}
 Data defined properties for different item types. More...
enum  PropertyValueType { EvaluatedValue = 0, OriginalValue }
 Specifies whether the value returned by a function should be the original, user set value, or the current evaluated value for the property. More...
- Public Slots inherited from QgsComposerObject
virtual void repaint ()
 Triggers a redraw for the item.
virtual void refreshDataDefinedProperty (const DataDefinedProperty property=AllProperties)
 Refreshes a data defined property for the item by reevaluating the property's value and redrawing the item with this new value.
- Signals inherited from QgsComposerObject
void itemChanged ()
 Emitted when the item changes.
- Protected Member Functions inherited from QgsComposerObject
bool dataDefinedEvaluate (const QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue)
 Evaluate a data defined property and return the calculated value.

Detailed Description

An item which is drawn inside a QgsComposerMap, eg a grid or map overview.

Constructor & Destructor Documentation

QgsComposerMapItem::QgsComposerMapItem ( const QString &  name,
QgsComposerMap map 
)

Constructor for QgsComposerMapItem.

Parameters
namefriendly display name for item
mapQgsComposerMap the item is attached to
QgsComposerMapItem::~QgsComposerMapItem ( )
virtual

Member Function Documentation

virtual const QgsComposerMap* QgsComposerMapItem::composerMap ( ) const
inlinevirtual

Get composer map for the item.

Returns
composer map
See Also
setComposerMap
virtual void QgsComposerMapItem::draw ( QPainter *  painter)
pure virtual

Draws the item on to a painter.

Parameters
painterdestination QPainter

Implemented in QgsComposerMapGrid, and QgsComposerMapOverview.

virtual bool QgsComposerMapItem::enabled ( ) const
inlinevirtual

Returns whether the item will be drawn.

Returns
true if item will be drawn on the map
See Also
setEnabled
QString QgsComposerMapItem::id ( ) const
inline

Get the unique id for the map item.

Returns
unique id
virtual QString QgsComposerMapItem::name ( ) const
inlinevirtual

Get friendly display name for the item.

Returns
display name
See Also
setName
bool QgsComposerMapItem::readXML ( const QDomElement &  itemElem,
const QDomDocument &  doc 
)
virtual

Sets map item state from a DOM document.

Parameters
itemElemis DOM node corresponding to a 'ComposerMapGrid' tag
docis DOM document
See Also
writeXML

Reimplemented from QgsComposerObject.

Reimplemented in QgsComposerMapGrid, and QgsComposerMapOverview.

void QgsComposerMapItem::setComposerMap ( QgsComposerMap map)
virtual

Sets composer map for the item.

Parameters
mapcomposer map
See Also
composerMap
virtual void QgsComposerMapItem::setEnabled ( const bool  enabled)
inlinevirtual

Controls whether the item will be drawn.

Parameters
enabledset to true to enable drawing of the item
See Also
enabled
virtual void QgsComposerMapItem::setName ( const QString &  name)
inlinevirtual

Sets the friendly display name for the item.

Parameters
namedisplay name
See Also
name
virtual bool QgsComposerMapItem::usesAdvancedEffects ( ) const
inlinevirtual

Returns true if the item is drawn using advanced effects, such as blend modes.

Returns
true if item uses advanced effects

Reimplemented in QgsComposerMapGrid, and QgsComposerMapOverview.

bool QgsComposerMapItem::writeXML ( QDomElement &  elem,
QDomDocument &  doc 
) const
virtual

Stores map item state in DOM element.

Parameters
elemis DOM element corresponding to a 'ComposerMap' tag
docDOM document
See Also
readXML

Reimplemented from QgsComposerObject.

Reimplemented in QgsComposerMapGrid, and QgsComposerMapOverview.

Member Data Documentation

QgsComposerMap* QgsComposerMapItem::mComposerMap
protected

Associated composer map.

bool QgsComposerMapItem::mEnabled
protected

True if item is to be displayed on map.

QString QgsComposerMapItem::mName
protected

Friendly display name.

QString QgsComposerMapItem::mUuid
protected

Unique id.


The documentation for this class was generated from the following files: