QGIS API Documentation
2.8.2-Wien
|
The QgsLayerTreeMapCanvasBridge class takes care of updates of layer set for QgsMapCanvas from a layer tree. More...
#include <qgslayertreemapcanvasbridge.h>
Public Slots | |
void | readProject (const QDomDocument &doc) |
void | setCanvasLayers () |
force update of canvas layers from the layer tree. Normally this should not be needed to be called. | |
void | setCustomLayerOrder (const QStringList &order) |
void | setHasCustomLayerOrder (bool state) |
void | writeProject (QDomDocument &doc) |
Signals | |
void | customLayerOrderChanged (const QStringList &order) |
void | hasCustomLayerOrderChanged (bool) |
Public Member Functions | |
QgsLayerTreeMapCanvasBridge (QgsLayerTreeGroup *root, QgsMapCanvas *canvas, QObject *parent=0) | |
Constructor: does not take ownership of the layer tree nor canvas. | |
bool | autoEnableCrsTransform () const |
bool | autoSetupOnFirstLayer () const |
void | clear () |
QStringList | customLayerOrder () const |
QStringList | defaultLayerOrder () const |
bool | hasCustomLayerOrder () const |
QgsMapCanvas * | mapCanvas () const |
QgsLayerTreeGroup * | rootGroup () const |
void | setAutoEnableCrsTransform (bool enabled) |
if enabled, will automatically turn on on-the-fly reprojection of layers if a layer with different source CRS is added | |
void | setAutoSetupOnFirstLayer (bool enabled) |
if enabled, will automatically set full canvas extent and destination CRS + map units when first layer(s) are added |
Protected Slots | |
void | nodeAddedChildren (QgsLayerTreeNode *node, int indexFrom, int indexTo) |
void | nodeCustomPropertyChanged (QgsLayerTreeNode *node, QString key) |
void | nodeRemovedChildren () |
void | nodeVisibilityChanged () |
Protected Member Functions | |
void | defaultLayerOrder (QgsLayerTreeNode *node, QStringList &order) const |
void | deferredSetCanvasLayers () |
void | setCanvasLayers (QgsLayerTreeNode *node, QList< QgsMapCanvasLayer > &layers) |
Protected Attributes | |
bool | mAutoEnableCrsTransform |
bool | mAutoSetupOnFirstLayer |
QgsMapCanvas * | mCanvas |
QStringList | mCustomLayerOrder |
QgsCoordinateReferenceSystem | mFirstCRS |
bool | mHasCustomLayerOrder |
bool | mHasFirstLayer |
bool | mLastLayerCount |
bool | mPendingCanvasUpdate |
QgsLayerTreeGroup * | mRoot |
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 44 of file qgslayertreemapcanvasbridge.h.
QgsLayerTreeMapCanvasBridge::QgsLayerTreeMapCanvasBridge | ( | QgsLayerTreeGroup * | root, |
QgsMapCanvas * | canvas, | ||
QObject * | parent = 0 |
||
) |
Constructor: does not take ownership of the layer tree nor canvas.
Definition at line 24 of file qgslayertreemapcanvasbridge.cpp.
|
inline |
Definition at line 69 of file qgslayertreemapcanvasbridge.h.
|
inline |
Definition at line 64 of file qgslayertreemapcanvasbridge.h.
void QgsLayerTreeMapCanvasBridge::clear | ( | ) |
Definition at line 42 of file qgslayertreemapcanvasbridge.cpp.
|
inline |
Definition at line 57 of file qgslayertreemapcanvasbridge.h.
|
signal |
QStringList QgsLayerTreeMapCanvasBridge::defaultLayerOrder | ( | ) | const |
Definition at line 48 of file qgslayertreemapcanvasbridge.cpp.
|
protected |
Definition at line 55 of file qgslayertreemapcanvasbridge.cpp.
|
protected |
Definition at line 243 of file qgslayertreemapcanvasbridge.cpp.
|
inline |
Definition at line 56 of file qgslayertreemapcanvasbridge.h.
|
signal |
|
inline |
Definition at line 54 of file qgslayertreemapcanvasbridge.h.
|
protectedslot |
Definition at line 252 of file qgslayertreemapcanvasbridge.cpp.
|
protectedslot |
Definition at line 308 of file qgslayertreemapcanvasbridge.cpp.
|
protectedslot |
Definition at line 284 of file qgslayertreemapcanvasbridge.cpp.
|
protectedslot |
Definition at line 303 of file qgslayertreemapcanvasbridge.cpp.
|
slot |
Definition at line 183 of file qgslayertreemapcanvasbridge.cpp.
|
inline |
Definition at line 53 of file qgslayertreemapcanvasbridge.h.
|
inline |
if enabled, will automatically turn on on-the-fly reprojection of layers if a layer with different source CRS is added
Definition at line 68 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 63 of file qgslayertreemapcanvasbridge.h.
|
slot |
force update of canvas layers from the layer tree. Normally this should not be needed to be called.
Definition at line 99 of file qgslayertreemapcanvasbridge.cpp.
|
protected |
Definition at line 231 of file qgslayertreemapcanvasbridge.cpp.
|
slot |
Definition at line 79 of file qgslayertreemapcanvasbridge.cpp.
|
slot |
Definition at line 68 of file qgslayertreemapcanvasbridge.cpp.
|
slot |
Definition at line 214 of file qgslayertreemapcanvasbridge.cpp.
|
protected |
Definition at line 109 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 108 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 101 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 106 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 113 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 105 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 111 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 112 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 103 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 100 of file qgslayertreemapcanvasbridge.h.