28 , mPendingCanvasUpdate( false )
29 , mHasCustomLayerOrder( false )
30 , mAutoSetupOnFirstLayer( true )
31 , mAutoEnableCrsTransform( true )
32 , mLastLayerCount( root->findLayers().count() )
89 qSort( sortedNewOrder );
91 if ( defOrder.
size() < sortedNewOrder.
size() )
96 for (
int i = 0; i < sortedNewOrder.
size(); i++ )
98 if ( !ids.contains( sortedNewOrder[i] ) )
106 if ( defOrder != sortedNewOrder )
133 int currentLayerCount = layerNodes.
count();
143 if ( layerNode->
layer() &&
193 mLastLayerCount = currentLayerCount;
194 if ( currentLayerCount == 0 )
218 if ( !customOrderElem.
isNull() )
222 while ( !itemElem.
isNull() )
278 for (
int i = indexFrom; i <= indexTo; ++i )
292 foreach (
QString layerId, layerIds )
315 for (
int i = toRemove.
count() - 1; i >= 0; --i )
330 if ( key ==
"overview" )
QObject * child(const char *objName, const char *inheritsClass, bool recursiveSearch) const
static bool readOldLegendLayerOrder(const QDomElement &legendElem, bool &hasCustomOrder, QStringList &order)
Try to load custom layer order from.
Layer tree group node serves as a container for layers and further groups.
void hasCustomLayerOrderChanged(bool)
void setCustomLayerOrder(const QStringList &order)
QgsLayerTreeGroup * mRoot
bool mHasCustomLayerOrder
QDomNode appendChild(const QDomNode &newChild)
QVariant customProperty(const QString &key, const QVariant &defaultValue=QVariant()) const
Read a custom property from layer.
QString attribute(const QString &name, const QString &defValue) const
QgsMapLayer * layer() const
const T & at(int i) const
const QObjectList & children() const
A class that stores visibility and presence in overview flags together with pointer to the layer...
bool contains(const QString &str, Qt::CaseSensitivity cs) const
QDomElement nextSiblingElement(const QString &tagName) const
void setHasCustomLayerOrder(bool state)
const QgsMapSettings & mapSettings() const
Get access to properties used for map rendering.
bool hasCrsTransformEnabled() const
returns true if projections are enabled for this layer set
QDomElement documentElement() const
void setCanvasLayers()
force update of canvas layers from the layer tree. Normally this should not be needed to be called...
QStringList defaultLayerOrder() const
Map canvas is a class for displaying all GIS data types on a canvas.
QgsLayerTreeGroup * toGroup(QgsLayerTreeNode *node)
Cast node to a group. No type checking is done - use isGroup() to find out whether this operation is ...
void setDestinationCrs(const QgsCoordinateReferenceSystem &crs)
sets destination coordinate reference system
void setCrsTransformEnabled(bool enabled)
sets whether to use projections for this layer set
Qt::CheckState isVisible() const
int count(const T &value) const
void append(const T &value)
int toInt(bool *ok) const
void nodeCustomPropertyChanged(QgsLayerTreeNode *node, QString key)
bool mAutoEnableCrsTransform
void setAttribute(const QString &name, const QString &value)
void setLayerSet(QList< QgsMapCanvasLayer > &layers)
int toInt(bool *ok, int base) const
QList< QgsLayerTreeLayer * > findLayers() const
Find all layer nodes. Searches recursively the whole sub-tree.
int removeAll(const T &value)
void nodeAddedChildren(QgsLayerTreeNode *node, int indexFrom, int indexTo)
This class is a base class for nodes in a layer tree.
void nodeVisibilityChanged()
QList< QgsLayerTreeNode * > children()
Get list of children of the node. Children are owned by the parent.
bool isLayer(QgsLayerTreeNode *node)
Check whether the node is a valid layer node.
void readProject(const QDomDocument &doc)
QDomText createTextNode(const QString &value)
QgsLayerTreeMapCanvasBridge(QgsLayerTreeGroup *root, QgsMapCanvas *canvas, QObject *parent=0)
Constructor: does not take ownership of the layer tree nor canvas.
void deferredSetCanvasLayers()
void nodeRemovedChildren()
QgsLayerTreeLayer * toLayer(QgsLayerTreeNode *node)
Cast node to a layer. No type checking is done - use isLayer() to find out whether this operation is ...
bool mPendingCanvasUpdate
QStringList mCustomLayerOrder
bool mAutoSetupOnFirstLayer
QDomElement firstChildElement(const QString &tagName) const
void zoomToFullExtent()
Zoom to the full extent of all layers.
Class for storing a coordinate reference system (CRS)
QgsLayerTreeLayer * findLayer(const QString &layerId) const
Find layer node representing the map layer specified by its ID. Searches recursively the whole sub-tr...
const QgsCoordinateReferenceSystem & crs() const
Returns layer's spatial reference system.
void writeProject(QDomDocument &doc)
void customLayerOrderChanged(const QStringList &order)
void setMapUnits(QGis::UnitType mapUnits)
Set map units (needed by project properties dialog)
QDomElement createElement(const QString &tagName)
QgsCoordinateReferenceSystem mFirstCRS
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Represents a vector layer which manages a vector based data sets.
bool isGroup(QgsLayerTreeNode *node)
Check whether the node is a valid group node.
Layer tree node points to a map layer.
QGis::UnitType mapUnits() const