QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsLayoutItemMapOverviewStack Class Reference

A collection of overviews which are drawn above the map content in a QgsLayoutItemMap. More...

#include <qgslayoutitemmapoverview.h>

Inheritance diagram for QgsLayoutItemMapOverviewStack:
Inheritance graph
[legend]

Public Member Functions

 QgsLayoutItemMapOverviewStack (QgsLayoutItemMap *map)
 Constructor for QgsLayoutItemMapOverviewStack, attached to the specified map.
 
void addOverview (QgsLayoutItemMapOverview *overview)
 Adds a new map overview to the stack and takes ownership of the overview.
 
QList< QgsLayoutItemMapOverview * > asList () const
 Returns a list of QgsLayoutItemMapOverviews contained by the stack.
 
QList< QgsMapLayer * > modifyMapLayerList (const QList< QgsMapLayer * > &layers)
 Alters the list of map layers which will be rendered for the link map item, inserting temporary layers which represent overview extents as required.
 
void moveOverviewDown (const QString &overviewId)
 Moves an overview with matching overviewId down the stack, causing it to be rendered below other overviews.
 
void moveOverviewUp (const QString &overviewId)
 Moves an overview with matching overviewId up the stack, causing it to be rendered above other overviews.
 
QgsLayoutItemMapOverviewoperator[] (int index)
 Returns a reference to an overview at the specified index within the stack.
 
QgsLayoutItemMapOverviewoverview (const QString &overviewId) const
 Returns a reference to an overview with matching overviewId within the stack.
 
QgsLayoutItemMapOverviewoverview (int index) const
 Returns a reference to an overview at the specified index within the stack.
 
bool readXml (const QDomElement &elem, const QDomDocument &doc, const QgsReadWriteContext &context) override
 Sets the item stack's state from a DOM document, where element is a DOM node corresponding to a 'LayoutMap' tag.
 
void removeOverview (const QString &overviewId)
 Removes an overview with matching overviewId from the stack and deletes the corresponding QgsLayoutItemMapOverview.
 
- Public Member Functions inherited from QgsLayoutItemMapItemStack
 QgsLayoutItemMapItemStack (QgsLayoutItemMap *map)
 Constructor for QgsLayoutItemMapItemStack, attached to the specified map.
 
virtual ~QgsLayoutItemMapItemStack ()
 
bool containsAdvancedEffects () const
 Returns whether any items within the stack contain advanced effects, such as blending modes.
 
void drawItems (QPainter *painter, bool ignoreStacking=true)
 Draws the items from the stack on a specified painter.
 
virtual void finalizeRestoreFromXml ()
 Called after all pending items have been restored from XML.
 
bool hasEnabledItems () const
 Returns true if the stack has any currently enabled items.
 
QgsLayoutItemMapItemitem (int index) const
 Returns a reference to the item at the specified index within the stack.
 
int size () const
 Returns the number of items in the stack.
 
virtual bool writeXml (QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context) const
 Stores the state of the item stack in a DOM node, where element is the DOM element corresponding to a 'LayoutMap' tag.
 

Additional Inherited Members

- Protected Member Functions inherited from QgsLayoutItemMapItemStack
void addItem (QgsLayoutItemMapItem *item)
 Adds a new map item to the stack and takes ownership of the item.
 
QList< QgsLayoutItemMapItem * > asList () const
 Returns a list of QgsLayoutItemMapItems contained by the stack.
 
QgsLayoutItemMapItemitem (const QString &itemId) const
 Returns a reference to an item which matching itemId within the stack.
 
void moveItemDown (const QString &itemId)
 Moves an item which matching itemId up the stack, causing it to be rendered above other items.
 
void moveItemUp (const QString &itemId)
 Moves an item which matching itemId up the stack, causing it to be rendered above other items.
 
QgsLayoutItemMapItemoperator[] (int index)
 Returns a reference to an item at the specified index within the stack.
 
void removeItem (const QString &itemId)
 Removes an item which matching itemId from the stack and deletes the corresponding QgsLayoutItemMapItem.
 
void removeItems ()
 Clears the item stack and deletes all QgsLayoutItemMapItems contained by the stack.
 
- Protected Attributes inherited from QgsLayoutItemMapItemStack
QList< QgsLayoutItemMapItem * > mItems
 
QgsLayoutItemMapmMap = nullptr
 

Detailed Description

A collection of overviews which are drawn above the map content in a QgsLayoutItemMap.

The overview stack controls which overviews are drawn and the order they are drawn in.

See also
QgsLayoutItemMapOverview
Since
QGIS 3.0

Definition at line 42 of file qgslayoutitemmapoverview.h.

Constructor & Destructor Documentation

◆ QgsLayoutItemMapOverviewStack()

QgsLayoutItemMapOverviewStack::QgsLayoutItemMapOverviewStack ( QgsLayoutItemMap map)

Constructor for QgsLayoutItemMapOverviewStack, attached to the specified map.

Definition at line 389 of file qgslayoutitemmapoverview.cpp.

Member Function Documentation

◆ addOverview()

void QgsLayoutItemMapOverviewStack::addOverview ( QgsLayoutItemMapOverview overview)

Adds a new map overview to the stack and takes ownership of the overview.

The overview will be added to the end of the stack, and rendered above any existing map overviews already present in the stack.

Note
After adding a overview to the stack, update() should be called for the QgsLayoutItemMap to prevent rendering artifacts.
See also
removeOverview()

Definition at line 395 of file qgslayoutitemmapoverview.cpp.

◆ asList()

QList< QgsLayoutItemMapOverview * > QgsLayoutItemMapOverviewStack::asList ( ) const

Returns a list of QgsLayoutItemMapOverviews contained by the stack.

Definition at line 434 of file qgslayoutitemmapoverview.cpp.

◆ modifyMapLayerList()

QList< QgsMapLayer * > QgsLayoutItemMapOverviewStack::modifyMapLayerList ( const QList< QgsMapLayer * > &  layers)

Alters the list of map layers which will be rendered for the link map item, inserting temporary layers which represent overview extents as required.

Since
QGIS 3.6

Definition at line 466 of file qgslayoutitemmapoverview.cpp.

◆ moveOverviewDown()

void QgsLayoutItemMapOverviewStack::moveOverviewDown ( const QString &  overviewId)

Moves an overview with matching overviewId down the stack, causing it to be rendered below other overviews.

Note
After moving an overview within the stack, update() should be called for the QgsLayoutItemMap to redraw the map with the new overview stack order.
See also
moveOverviewUp()

Definition at line 410 of file qgslayoutitemmapoverview.cpp.

◆ moveOverviewUp()

void QgsLayoutItemMapOverviewStack::moveOverviewUp ( const QString &  overviewId)

Moves an overview with matching overviewId up the stack, causing it to be rendered above other overviews.

Note
After moving an overview within the stack, update() should be called for the QgsLayoutItemMap to redraw the map with the new overview stack order.
See also
moveOverviewDown()

Definition at line 405 of file qgslayoutitemmapoverview.cpp.

◆ operator[]()

QgsLayoutItemMapOverview & QgsLayoutItemMapOverviewStack::operator[] ( int  index)

Returns a reference to an overview at the specified index within the stack.

See also
overview()

Definition at line 427 of file qgslayoutitemmapoverview.cpp.

◆ overview() [1/2]

QgsLayoutItemMapOverview * QgsLayoutItemMapOverviewStack::overview ( const QString &  overviewId) const

Returns a reference to an overview with matching overviewId within the stack.

Definition at line 415 of file qgslayoutitemmapoverview.cpp.

◆ overview() [2/2]

QgsLayoutItemMapOverview * QgsLayoutItemMapOverviewStack::overview ( int  index) const

Returns a reference to an overview at the specified index within the stack.

Definition at line 421 of file qgslayoutitemmapoverview.cpp.

◆ readXml()

bool QgsLayoutItemMapOverviewStack::readXml ( const QDomElement &  element,
const QDomDocument &  doc,
const QgsReadWriteContext context 
)
overridevirtual

Sets the item stack's state from a DOM document, where element is a DOM node corresponding to a 'LayoutMap' tag.

Returns true if read was successful.

See also
writeXml()

Implements QgsLayoutItemMapItemStack.

Definition at line 449 of file qgslayoutitemmapoverview.cpp.

◆ removeOverview()

void QgsLayoutItemMapOverviewStack::removeOverview ( const QString &  overviewId)

Removes an overview with matching overviewId from the stack and deletes the corresponding QgsLayoutItemMapOverview.

Note
After removing an overview from the stack, update() should be called for the QgsLayoutItemMap to prevent rendering artifacts.
See also
addOverview()

Definition at line 400 of file qgslayoutitemmapoverview.cpp.


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