QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
The QgsLayerTreeMapCanvasBridge class takes care of updates of layer set for QgsMapCanvas from a layer tree. More...
#include <qgslayertreemapcanvasbridge.h>
Signals | |
void | canvasLayersChanged (const QList< QgsMapLayer * > &layers) |
Emitted when the set of layers (or order of layers) visible in the canvas changes. More... | |
Public Member Functions | |
QgsLayerTreeMapCanvasBridge (QgsLayerTree *root, QgsMapCanvas *canvas, QObject *parent SIP_TRANSFERTHIS=nullptr) | |
Constructor: does not take ownership of the layer tree nor canvas. More... | |
bool | autoSetupOnFirstLayer () const |
QgsMapCanvas * | mapCanvas () const |
QgsMapOverviewCanvas * | overviewCanvas () const |
Returns associated overview canvas (may be nullptr ) More... | |
QgsLayerTree * | rootGroup () const |
void | setAutoSetupOnFirstLayer (bool enabled) |
if enabled, will automatically set full canvas extent and destination CRS + map units when first layer(s) are added More... | |
Q_INVOKABLE void | setCanvasLayers () |
force update of canvas layers from the layer tree. Normally this should not be needed to be called. More... | |
void | setOverviewCanvas (QgsMapOverviewCanvas *overviewCanvas) |
Associates overview canvas with the bridge, so the overview will be updated whenever main canvas is updated. More... | |
The QgsLayerTreeMapCanvasBridge class takes care of updates of layer set for QgsMapCanvas from a layer tree.
The class listens to the updates in the layer tree and updates the list of layers for rendering whenever some layers are added, removed, or their visibility changes.
The update of layers is not done immediately - it is postponed, so a series of updates to the layer tree will trigger just one update of canvas layers.
Also allows the client to override the default order of layers. This is useful in advanced cases where the grouping in layer tree should be independent from the actual order in the canvas.
Definition at line 48 of file qgslayertreemapcanvasbridge.h.
QgsLayerTreeMapCanvasBridge::QgsLayerTreeMapCanvasBridge | ( | QgsLayerTree * | root, |
QgsMapCanvas * | canvas, | ||
QObject *parent | SIP_TRANSFERTHIS = nullptr |
||
) |
Constructor: does not take ownership of the layer tree nor canvas.
Definition at line 28 of file qgslayertreemapcanvasbridge.cpp.
|
inline |
Definition at line 88 of file qgslayertreemapcanvasbridge.h.
|
signal |
Emitted when the set of layers (or order of layers) visible in the canvas changes.
|
inline |
Definition at line 56 of file qgslayertreemapcanvasbridge.h.
|
inline |
Returns associated overview canvas (may be nullptr
)
Definition at line 81 of file qgslayertreemapcanvasbridge.h.
|
inline |
Definition at line 55 of file qgslayertreemapcanvasbridge.h.
|
inline |
if enabled, will automatically set full canvas extent and destination CRS + map units when first layer(s) are added
Definition at line 87 of file qgslayertreemapcanvasbridge.h.
void QgsLayerTreeMapCanvasBridge::setCanvasLayers | ( | ) |
force update of canvas layers from the layer tree. Normally this should not be needed to be called.
Definition at line 45 of file qgslayertreemapcanvasbridge.cpp.
|
inline |
Associates overview canvas with the bridge, so the overview will be updated whenever main canvas is updated.
Definition at line 62 of file qgslayertreemapcanvasbridge.h.