QGIS API Documentation
3.0.2-Girona (307d082)
|
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=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 null) 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 | setOvervewCanvas (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 49 of file qgslayertreemapcanvasbridge.h.
QgsLayerTreeMapCanvasBridge::QgsLayerTreeMapCanvasBridge | ( | QgsLayerTree * | root, |
QgsMapCanvas * | canvas, | ||
QObject * | parent = nullptr |
||
) |
Constructor: does not take ownership of the layer tree nor canvas.
Definition at line 26 of file qgslayertreemapcanvasbridge.cpp.
|
inline |
Definition at line 76 of file qgslayertreemapcanvasbridge.h.
|
signal |
Emitted when the set of layers (or order of layers) visible in the canvas changes.
|
inline |
Definition at line 57 of file qgslayertreemapcanvasbridge.h.
|
inline |
Returns associated overview canvas (may be null)
Definition at line 69 of file qgslayertreemapcanvasbridge.h.
|
inline |
Definition at line 56 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 75 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 41 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 63 of file qgslayertreemapcanvasbridge.h.