QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
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. More... | |
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=nullptr) | |
Constructor: does not take ownership of the layer tree nor canvas. More... | |
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 More... | |
void | setAutoSetupOnFirstLayer (bool enabled) |
if enabled, will automatically set full canvas extent and destination CRS + map units when first layer(s) are added More... | |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Protected Slots | |
void | nodeAddedChildren (QgsLayerTreeNode *node, int indexFrom, int indexTo) |
void | nodeCustomPropertyChanged (QgsLayerTreeNode *node, const 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 Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Attributes | |
bool | mAutoEnableCrsTransform |
bool | mAutoSetupOnFirstLayer |
QgsMapCanvas * | mCanvas |
QStringList | mCustomLayerOrder |
QgsCoordinateReferenceSystem | mFirstCRS |
bool | mHasCustomLayerOrder |
bool | mHasFirstLayer |
bool | mLastLayerCount |
bool | mPendingCanvasUpdate |
QgsLayerTreeGroup * | mRoot |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
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 45 of file qgslayertreemapcanvasbridge.h.
QgsLayerTreeMapCanvasBridge::QgsLayerTreeMapCanvasBridge | ( | QgsLayerTreeGroup * | root, |
QgsMapCanvas * | canvas, | ||
QObject * | parent = nullptr |
||
) |
Constructor: does not take ownership of the layer tree nor canvas.
Definition at line 24 of file qgslayertreemapcanvasbridge.cpp.
|
inline |
Definition at line 70 of file qgslayertreemapcanvasbridge.h.
|
inline |
Definition at line 65 of file qgslayertreemapcanvasbridge.h.
void QgsLayerTreeMapCanvasBridge::clear | ( | ) |
Definition at line 42 of file qgslayertreemapcanvasbridge.cpp.
|
inline |
Definition at line 58 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 260 of file qgslayertreemapcanvasbridge.cpp.
|
inline |
Definition at line 57 of file qgslayertreemapcanvasbridge.h.
|
signal |
|
inline |
Definition at line 55 of file qgslayertreemapcanvasbridge.h.
|
protectedslot |
Definition at line 269 of file qgslayertreemapcanvasbridge.cpp.
|
protectedslot |
Definition at line 325 of file qgslayertreemapcanvasbridge.cpp.
|
protectedslot |
Definition at line 301 of file qgslayertreemapcanvasbridge.cpp.
|
protectedslot |
Definition at line 320 of file qgslayertreemapcanvasbridge.cpp.
|
slot |
Definition at line 198 of file qgslayertreemapcanvasbridge.cpp.
|
inline |
Definition at line 54 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 69 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 64 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 116 of file qgslayertreemapcanvasbridge.cpp.
|
protected |
Definition at line 248 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 231 of file qgslayertreemapcanvasbridge.cpp.
|
protected |
Definition at line 110 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 109 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 102 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 107 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 114 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 106 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 112 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 113 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 104 of file qgslayertreemapcanvasbridge.h.
|
protected |
Definition at line 101 of file qgslayertreemapcanvasbridge.h.