A collection of map items which are drawn above the map content in a QgsComposerMap.
More...
#include <qgscomposermapitem.h>
Protected Member Functions |
void | addItem (QgsComposerMapItem *item) |
| Adds a new map item to the stack and takes ownership of the item.
|
void | removeItem (const QString &itemId) |
| Removes an item from the stack and deletes the corresponding QgsComposerMapItem.
|
void | moveItemUp (const QString &itemId) |
| Moves an item up the stack, causing it to be rendered above other items.
|
void | moveItemDown (const QString &itemId) |
| Moves an item up the stack, causing it to be rendered above other items.
|
const QgsComposerMapItem * | constItem (const QString &itemId) const |
| Returns a const reference to an item within the stack.
|
QgsComposerMapItem * | item (const QString &itemId) const |
| Returns a reference to an item within the stack.
|
QgsComposerMapItem * | item (const int index) const |
| Returns a reference to an item within the stack.
|
QgsComposerMapItem & | operator[] (int idx) |
| Returns a reference to an item within the stack.
|
QList< QgsComposerMapItem * > | asList () const |
| Returns a list of QgsComposerMapItems contained by the stack.
|
void | removeItems () |
| Clears the item stack and deletes all QgsComposerMapItems contained by the stack.
|
Detailed Description
A collection of map items which are drawn above the map content in a QgsComposerMap.
The item stack controls which items are drawn and the order they are drawn in.
- Note
- added in QGIS 2.5
- See Also
- QgsComposerMapItem
Constructor & Destructor Documentation
QgsComposerMapItemStack::QgsComposerMapItemStack |
( |
QgsComposerMap * |
map | ) |
|
QgsComposerMapItemStack::~QgsComposerMapItemStack |
( |
| ) |
|
|
virtual |
Member Function Documentation
Adds a new map item to the stack and takes ownership of the item.
The item will be added to the end of the stack, and rendered above any existing map items already present in the stack.
- Parameters
-
- Note
- after adding an item to the stack update() should be called for the QgsComposerMap to prevent rendering artifacts
- See Also
- removeItem
const QgsComposerMapItem * QgsComposerMapItemStack::constItem |
( |
const QString & |
itemId | ) |
const |
|
protected |
Returns a const reference to an item within the stack.
- Parameters
-
- Returns
- const reference to item, if found
- See Also
- item
bool QgsComposerMapItemStack::containsAdvancedEffects |
( |
| ) |
const |
Returns whether any items within the stack contain advanced effects, such as blending modes.
- Returns
- true if item stack contains advanced effects
void QgsComposerMapItemStack::drawItems |
( |
QPainter * |
painter | ) |
|
Draws the items from the stack on a specified painter.
- Parameters
-
painter | destination QPainter |
Returns a reference to an item within the stack.
- Parameters
-
- Returns
- reference to item if found
- See Also
- constItem
Returns a reference to an item within the stack.
- Parameters
-
index | item position in the stack |
- Returns
- reference to item if found
- See Also
- constItem
void QgsComposerMapItemStack::moveItemDown |
( |
const QString & |
itemId | ) |
|
|
protected |
Moves an item up the stack, causing it to be rendered above other items.
- Parameters
-
- Note
- after moving an item within the stack, update() should be called for the QgsComposerMap to redraw the map with the new item stack order
- See Also
- moveItemUp
void QgsComposerMapItemStack::moveItemUp |
( |
const QString & |
itemId | ) |
|
|
protected |
Moves an item up the stack, causing it to be rendered above other items.
- Parameters
-
- Note
- after moving an item within the stack, update() should be called for the QgsComposerMap to redraw the map with the new item stack order
- See Also
- moveItemDown
virtual bool QgsComposerMapItemStack::readXML |
( |
const QDomElement & |
elem, |
|
|
const QDomDocument & |
doc |
|
) |
| |
|
pure virtual |
void QgsComposerMapItemStack::removeItem |
( |
const QString & |
itemId | ) |
|
|
protected |
Removes an item from the stack and deletes the corresponding QgsComposerMapItem.
- Parameters
-
- Note
- after removing an item from the stack, update() should be called for the QgsComposerMap to prevent rendering artifacts
- See Also
- addItem
void QgsComposerMapItemStack::removeItems |
( |
| ) |
|
|
protected |
Clears the item stack and deletes all QgsComposerMapItems contained by the stack.
int QgsComposerMapItemStack::size |
( |
void |
| ) |
const |
|
inline |
Returns the number of items in the stack.
- Returns
- number of items in the stack
bool QgsComposerMapItemStack::writeXML |
( |
QDomElement & |
elem, |
|
|
QDomDocument & |
doc |
|
) |
| const |
|
virtual |
Stores the state of the item stack in a DOM node.
- Parameters
-
elem | is DOM element corresponding to a 'ComposerMap' tag |
doc | DOM document |
- Returns
- true if write was successful
- See Also
- readXML
Member Data Documentation
The documentation for this class was generated from the following files: