QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
|
An individual overview which is drawn above the map content in a QgsLayoutItemMap, and shows the extent of another QgsLayoutItemMap. More...
#include <qgslayoutitemmapoverview.h>
Public Slots | |
void | overviewExtentChanged () |
Handles recentering of the map and redrawing of the map's overview. More... | |
Public Slots inherited from QgsLayoutObject | |
virtual void | refresh () |
Refreshes the object, causing a recalculation of any property overrides. More... | |
Public Member Functions | |
QgsLayoutItemMapOverview (const QString &name, QgsLayoutItemMap *map) | |
Constructor for QgsLayoutItemMapOverview. More... | |
~QgsLayoutItemMapOverview () override | |
bool | accept (QgsStyleEntityVisitorInterface *visitor) const override |
Accepts the specified style entity visitor, causing it to visit all style entities associated with the map item. More... | |
QgsVectorLayer * | asMapLayer () |
Returns a vector layer to render as part of the QgsLayoutItemMap render, containing a feature representing the overview extent (and with an appropriate renderer set matching the overview's frameSymbol() ). More... | |
QPainter::CompositionMode | blendMode () const |
Retrieves the blending mode used for drawing the overview. More... | |
bool | centered () const |
Returns whether the extent of the map is forced to center on the overview. More... | |
void | connectSignals () |
Reconnects signals for overview map, so that overview correctly follows changes to source map's extent. More... | |
void | draw (QPainter *painter) override |
Draws the item on to a destination painter. More... | |
void | finalizeRestoreFromXml () override |
Called after all pending items have been restored from XML. More... | |
QgsFillSymbol * | frameSymbol () |
Returns the fill symbol used for drawing the overview extent. More... | |
const QgsFillSymbol * | frameSymbol () const |
Returns the fill symbol used for drawing the overview extent. More... | |
bool | inverted () const |
Returns whether the overview frame is inverted, ie, whether the shaded area is drawn outside the extent of the overview map. More... | |
QgsLayoutItemMap * | linkedMap () |
Returns the source map to show the overview extent of. More... | |
QgsMapLayer * | mapLayer () override |
Returns the internal map layer used by this item, if available. More... | |
bool | readXml (const QDomElement &itemElem, const QDomDocument &doc, const QgsReadWriteContext &context) override |
Sets the map item state from a DOM document, where element is the DOM node corresponding to a 'LayoutMapGrid' tag. More... | |
void | setBlendMode (QPainter::CompositionMode mode) |
Sets the blending mode used for drawing the overview. More... | |
void | setCentered (bool centered) |
Sets whether the extent of the map is forced to center on the overview. More... | |
void | setFrameSymbol (QgsFillSymbol *symbol) |
Sets the fill symbol used for drawing the overview extent. More... | |
void | setInverted (bool inverted) |
Sets whether the overview frame is inverted, ie, whether the shaded area is drawn outside the extent of the overview map. More... | |
void | setLinkedMap (QgsLayoutItemMap *map) |
Sets the map to show the overview extent of. More... | |
bool | usesAdvancedEffects () const override |
Returns true if the item is drawn using advanced effects, such as blend modes. More... | |
bool | writeXml (QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context) const override |
Stores map item state in a DOM element, where element is the DOM element corresponding to a 'LayoutMap' tag. More... | |
Public Member Functions inherited from QgsLayoutItemMapItem | |
QgsLayoutItemMapItem (const QString &name, QgsLayoutItemMap *map) | |
Constructor for QgsLayoutItemMapItem, attached to the specified map. More... | |
virtual bool | accept (QgsStyleEntityVisitorInterface *visitor) const |
Accepts the specified style entity visitor, causing it to visit all style entities associated with the map item. More... | |
QgsExpressionContext | createExpressionContext () const override |
This method needs to be reimplemented in all classes which implement this interface and return an expression context. More... | |
virtual void | draw (QPainter *painter)=0 |
Draws the item on to a destination painter. More... | |
bool | enabled () const |
Returns whether the item will be drawn. More... | |
virtual void | finalizeRestoreFromXml () |
Called after all pending items have been restored from XML. More... | |
QString | id () const |
Returns the unique id for the map item. More... | |
const QgsLayoutItemMap * | map () const |
Returns the layout item map for the item. More... | |
virtual QgsMapLayer * | mapLayer () |
Returns the internal map layer used by this item, if available. More... | |
QString | name () const |
Returns the friendly display name for the item. More... | |
virtual bool | readXml (const QDomElement &element, const QDomDocument &doc, const QgsReadWriteContext &context) |
Sets the map item state from a DOM document, where element is the DOM node corresponding to a 'LayoutMapGrid' tag. More... | |
virtual void | setEnabled (bool enabled) |
Controls whether the item will be drawn. More... | |
void | setMap (QgsLayoutItemMap *map) |
Sets the corresponding layout map for the item. More... | |
void | setName (const QString &name) |
Sets the friendly display name for the item. More... | |
void | setStackingLayer (QgsMapLayer *layer) |
Sets the item's stacking layer, which specifies where the in the map's stack the item should be rendered. More... | |
void | setStackingPosition (StackingPosition position) |
Sets the item's stacking position, which specifies where the in the map's stack the item should be rendered. More... | |
QgsMapLayer * | stackingLayer () const |
Returns the item's stacking layer, which specifies where the in the map's stack the item should be rendered. More... | |
StackingPosition | stackingPosition () const |
Returns the item's stacking position, which specifies where the in the map's stack the item should be rendered. More... | |
virtual bool | usesAdvancedEffects () const |
Returns true if the item is drawn using advanced effects, such as blend modes. More... | |
virtual bool | writeXml (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const |
Stores map item state in a DOM element, where element is the DOM element corresponding to a 'LayoutMap' tag. More... | |
Public Member Functions inherited from QgsLayoutObject | |
QgsLayoutObject (QgsLayout *layout) | |
Constructor for QgsLayoutObject, with the specified parent layout. More... | |
QgsExpressionContext | createExpressionContext () const override |
Creates an expression context relating to the objects' current state. More... | |
QStringList | customProperties () const |
Returns list of keys stored in custom properties for the object. More... | |
QVariant | customProperty (const QString &key, const QVariant &defaultValue=QVariant()) const |
Read a custom property from the object. More... | |
QgsPropertyCollection & | dataDefinedProperties () |
Returns a reference to the object's property collection, used for data defined overrides. More... | |
const QgsPropertyCollection & | dataDefinedProperties () const |
Returns a reference to the object's property collection, used for data defined overrides. More... | |
QgsLayout * | layout () |
Returns the layout the object is attached to. More... | |
const QgsLayout * | layout () const |
Returns the layout the object is attached to. More... | |
void | removeCustomProperty (const QString &key) |
Remove a custom property from the object. More... | |
void | setCustomProperty (const QString &key, const QVariant &value) |
Set a custom property for the object. More... | |
void | setDataDefinedProperties (const QgsPropertyCollection &collection) |
Sets the objects's property collection, used for data defined overrides. More... | |
Public Member Functions inherited from QgsExpressionContextGenerator | |
virtual | ~QgsExpressionContextGenerator ()=default |
virtual QgsExpressionContext | createExpressionContext () const =0 |
This method needs to be reimplemented in all classes which implement this interface and return an expression context. More... | |
An individual overview which is drawn above the map content in a QgsLayoutItemMap, and shows the extent of another QgsLayoutItemMap.
Definition at line 126 of file qgslayoutitemmapoverview.h.
QgsLayoutItemMapOverview::QgsLayoutItemMapOverview | ( | const QString & | name, |
QgsLayoutItemMap * | map | ||
) |
Constructor for QgsLayoutItemMapOverview.
name | friendly display name for overview |
map | QgsLayoutItemMap the overview is attached to |
Definition at line 36 of file qgslayoutitemmapoverview.cpp.
|
overridedefault |
|
overridevirtual |
Accepts the specified style entity visitor, causing it to visit all style entities associated with the map item.
Returns true
if the visitor should continue visiting other objects, or false
if visiting should be canceled.
Reimplemented from QgsLayoutItemMapItem.
Definition at line 318 of file qgslayoutitemmapoverview.cpp.
QgsVectorLayer * QgsLayoutItemMapOverview::asMapLayer | ( | ) |
Returns a vector layer to render as part of the QgsLayoutItemMap render, containing a feature representing the overview extent (and with an appropriate renderer set matching the overview's frameSymbol() ).
Ownership of the layer remain with the overview item.
Definition at line 257 of file qgslayoutitemmapoverview.cpp.
|
inline |
Retrieves the blending mode used for drawing the overview.
Definition at line 182 of file qgslayoutitemmapoverview.h.
|
inline |
Returns whether the extent of the map is forced to center on the overview.
Definition at line 208 of file qgslayoutitemmapoverview.h.
void QgsLayoutItemMapOverview::connectSignals | ( | ) |
Reconnects signals for overview map, so that overview correctly follows changes to source map's extent.
Definition at line 243 of file qgslayoutitemmapoverview.cpp.
|
overridevirtual |
Draws the item on to a destination painter.
Implements QgsLayoutItemMapItem.
Definition at line 56 of file qgslayoutitemmapoverview.cpp.
|
overridevirtual |
Called after all pending items have been restored from XML.
Map items can use this method to run steps which must take place after all items have been restored to the layout, such as connecting to signals emitted by other items, which may not have existed in the layout at the time readXml() was called. E.g. an overview can use this to connect to its linked map item after restoration from XML.
Reimplemented from QgsLayoutItemMapItem.
Definition at line 205 of file qgslayoutitemmapoverview.cpp.
QgsFillSymbol * QgsLayoutItemMapOverview::frameSymbol | ( | ) |
Returns the fill symbol used for drawing the overview extent.
Definition at line 335 of file qgslayoutitemmapoverview.cpp.
const QgsFillSymbol * QgsLayoutItemMapOverview::frameSymbol | ( | ) | const |
Returns the fill symbol used for drawing the overview extent.
Definition at line 340 of file qgslayoutitemmapoverview.cpp.
|
inline |
Returns whether the overview frame is inverted, ie, whether the shaded area is drawn outside the extent of the overview map.
Definition at line 195 of file qgslayoutitemmapoverview.h.
QgsLayoutItemMap * QgsLayoutItemMapOverview::linkedMap | ( | ) |
Returns the source map to show the overview extent of.
Definition at line 238 of file qgslayoutitemmapoverview.cpp.
|
overridevirtual |
Returns the internal map layer used by this item, if available.
Reimplemented from QgsLayoutItemMapItem.
Definition at line 313 of file qgslayoutitemmapoverview.cpp.
|
slot |
Handles recentering of the map and redrawing of the map's overview.
Definition at line 361 of file qgslayoutitemmapoverview.cpp.
|
overridevirtual |
Sets the map item state from a DOM document, where element is the DOM node corresponding to a 'LayoutMapGrid' tag.
Reimplemented from QgsLayoutItemMapItem.
Definition at line 180 of file qgslayoutitemmapoverview.cpp.
void QgsLayoutItemMapOverview::setBlendMode | ( | QPainter::CompositionMode | mode | ) |
Sets the blending mode used for drawing the overview.
Definition at line 345 of file qgslayoutitemmapoverview.cpp.
void QgsLayoutItemMapOverview::setCentered | ( | bool | centered | ) |
Sets whether the extent of the map is forced to center on the overview.
Definition at line 355 of file qgslayoutitemmapoverview.cpp.
void QgsLayoutItemMapOverview::setFrameSymbol | ( | QgsFillSymbol * | symbol | ) |
Sets the fill symbol used for drawing the overview extent.
Ownership is transferred to the overview.
Definition at line 330 of file qgslayoutitemmapoverview.cpp.
void QgsLayoutItemMapOverview::setInverted | ( | bool | inverted | ) |
Sets whether the overview frame is inverted, ie, whether the shaded area is drawn outside the extent of the overview map.
Definition at line 350 of file qgslayoutitemmapoverview.cpp.
void QgsLayoutItemMapOverview::setLinkedMap | ( | QgsLayoutItemMap * | map | ) |
Sets the map to show the overview extent of.
Definition at line 218 of file qgslayoutitemmapoverview.cpp.
|
overridevirtual |
Returns true
if the item is drawn using advanced effects, such as blend modes.
Reimplemented from QgsLayoutItemMapItem.
Definition at line 213 of file qgslayoutitemmapoverview.cpp.
|
overridevirtual |
Stores map item state in a DOM element, where element is the DOM element corresponding to a 'LayoutMap' tag.
Reimplemented from QgsLayoutItemMapItem.
Definition at line 157 of file qgslayoutitemmapoverview.cpp.