1/************************************************************************ 2 * This file has been generated automatically from * 3 * * 4 * src/core/layertree/qgslayertree.h * 5 * * 6 * Do not edit manually ! Edit header and run scripts/sipify.pl again * 7 ************************************************************************/ 8 9 10 11class QgsLayerTree : QgsLayerTreeGroup 12{ 13%Docstring 14Namespace with helper functions for layer tree operations. 15 16Only generally useful routines should be here. Miscellaneous utility functions for work 17with the layer tree are in QgsLayerTreeUtils class. 18 19.. versionadded:: 3.0 20%End 21 22%TypeHeaderCode 23#include "qgslayertree.h" 24%End 25 public: 26 27 static bool isGroup( QgsLayerTreeNode *node ); 28%Docstring 29Check whether the node is a valid group node 30 31.. versionadded:: 2.4 32%End 33 34 static bool isLayer( const QgsLayerTreeNode *node ); 35%Docstring 36Check whether the node is a valid layer node 37 38.. versionadded:: 2.4 39%End 40 41 42 43 44 QgsLayerTree(); 45%Docstring 46Create a new empty layer tree 47%End 48 49 QList<QgsMapLayer *> customLayerOrder() const; 50%Docstring 51The order in which layers will be rendered on the canvas. 52Will only be used if the property hasCustomLayerOrder is ``True``. 53If you need the current layer order that is active, prefer using :py:func:`~QgsLayerTree.layerOrder`. 54 55.. seealso:: :py:func:`setCustomLayerOrder` 56 57.. seealso:: :py:func:`layerOrder` 58 59.. seealso:: :py:func:`hasCustomLayerOrder` 60 61.. versionadded:: 3.0 62%End 63 64 void setCustomLayerOrder( const QList<QgsMapLayer *> &customLayerOrder ); 65%Docstring 66The order in which layers will be rendered on the canvas. 67Will only be used if the property hasCustomLayerOrder is ``True``. 68If you need the current layer order that is active, prefer using :py:func:`~QgsLayerTree.layerOrder`. 69 70.. seealso:: :py:func:`customLayerOrder` 71 72.. seealso:: :py:func:`layerOrder` 73 74.. seealso:: :py:func:`hasCustomLayerOrder` 75 76.. versionadded:: 3.0 77%End 78 79 void setCustomLayerOrder( const QStringList &customLayerOrder ) /PyName=setCustomLayerOrderByIds/; 80%Docstring 81The order in which layers will be rendered on the canvas. 82Will only be used if the property hasCustomLayerOrder is ``True``. 83If you need the current layer order that is active, prefer using :py:func:`~QgsLayerTree.layerOrder`. 84 85.. seealso:: :py:func:`customLayerOrder` 86 87.. seealso:: :py:func:`layerOrder` 88 89.. seealso:: :py:func:`hasCustomLayerOrder` 90 91.. versionadded:: 3.0 92%End 93 94 QList<QgsMapLayer *> layerOrder() const; 95%Docstring 96The order in which layers will be rendered on the canvas. 97Depending on hasCustomLayerOrder, this will return either the override 98customLayerOrder or the layer order derived from the tree. 99This property is read only. 100 101.. seealso:: :py:func:`customLayerOrder` 102 103.. versionadded:: 3.0 104%End 105 106 bool hasCustomLayerOrder() const; 107%Docstring 108Determines if the layer order should be derived from the layer tree 109or if a custom override order shall be used instead. 110 111.. seealso:: :py:func:`customLayerOrder` 112 113.. versionadded:: 3.0 114%End 115 116 void setHasCustomLayerOrder( bool hasCustomLayerOrder ); 117%Docstring 118Determines if the layer order should be derived from the layer tree 119or if a custom override order shall be used instead. 120 121.. seealso:: :py:func:`setCustomLayerOrder` 122 123.. versionadded:: 3.0 124%End 125 126 static QgsLayerTree *readXml( QDomElement &element, const QgsReadWriteContext &context ); 127%Docstring 128Load the layer tree from an XML element. 129It is not required that layers are loaded at this point. 130:py:func:`~QgsLayerTree.resolveReferences` needs to be called after loading the layers and 131before using the tree. 132 133.. versionadded:: 3.0 134%End 135 136 void readLayerOrderFromXml( const QDomElement &doc ); 137%Docstring 138Load the layer order from an XML element. 139Make sure that this is only called after the layers are loaded. 140 141.. versionadded:: 3.0 142%End 143 144 virtual void writeXml( QDomElement &parentElement, const QgsReadWriteContext &context ); 145 146 147 virtual QgsLayerTree *clone() const /Factory/; 148 149 150 void clear(); 151%Docstring 152Clear any information from this layer tree. 153 154.. versionadded:: 3.0 155%End 156 157 signals: 158 159 void customLayerOrderChanged(); 160%Docstring 161Emitted when the custom layer order has changed. 162 163.. versionadded:: 3.0 164%End 165 166 void layerOrderChanged(); 167%Docstring 168Emitted when the layer order has changed. 169 170.. versionadded:: 3.0 171%End 172 173 void hasCustomLayerOrderChanged( bool hasCustomLayerOrder ); 174%Docstring 175Emitted when the hasCustomLayerOrder flag changes. 176 177.. seealso:: :py:func:`hasCustomLayerOrder` 178 179.. versionadded:: 3.0 180%End 181 182}; 183 184/************************************************************************ 185 * This file has been generated automatically from * 186 * * 187 * src/core/layertree/qgslayertree.h * 188 * * 189 * Do not edit manually ! Edit header and run scripts/sipify.pl again * 190 ************************************************************************/ 191