28 , mRegistryRemovingLayers( false )
30 , mNewLayersVisible( true )
31 , mInsertionPointGroup( root )
32 , mInsertionPointIndex( 0 )
64 nodeLayer->setCustomProperty(
"embedded", 1 );
65 nodeLayer->setCustomProperty(
"embedded_project", projectFile );
87 Q_FOREACH (
const QString& layerId, layerIds )
100 for (
int i = indexFrom; i <= indexTo; ++i )
QObject * child(const char *objName, const char *inheritsClass, bool recursiveSearch) const
Layer tree group node serves as a container for layers and further groups.
QgsLayerTreeRegistryBridge(QgsLayerTreeGroup *root, QObject *parent=nullptr)
Base class for all map layer types.
const T & at(int i) const
void removeMapLayers(const QStringList &theLayerIds)
Remove a set of layers from the registry by layer ID.
QgsLayerTreeGroup * mInsertionPointGroup
void layersWillBeRemoved(const QStringList &layerIds)
void groupWillRemoveChildren(QgsLayerTreeNode *node, int indexFrom, int indexTo)
QgsLayerTreeGroup * toGroup(QgsLayerTreeNode *node)
Cast node to a group. No type checking is done - use isGroup() to find out whether this operation is ...
void addedLayersToLayerTree(const QList< QgsMapLayer *> &layers)
Tell others we have just added layers to the tree (used in QGIS to auto-select first newly added laye...
int count(const T &value) const
void layersAdded(const QList< QgsMapLayer *> &layers)
bool mRegistryRemovingLayers
QgsLayerTreeGroup * mRoot
QStringList mLayerIdsForRemoval
static void _collectLayerIdsInGroup(QgsLayerTreeGroup *group, int indexFrom, int indexTo, QStringList &lst)
QString layerIsEmbedded(const QString &id) const
Returns project file path if layer is embedded from other project file.
QgsLayerTreeNode * parent()
Get pointer to the parent. If parent is a null pointer, the node is a root node.
This class is a base class for nodes in a layer tree.
void setVisible(Qt::CheckState visible)
void insertChildNodes(int index, const QList< QgsLayerTreeNode *> &nodes)
Insert existing nodes at specified position. The nodes must not have a parent yet. The nodes will be owned by this group.
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 groupRemovedChildren()
QgsLayerTreeLayer * findLayer(const QString &layerId) const
Find layer node representing the map layer specified by its ID. Searches recursively the whole sub-tr...
static QgsMapLayerRegistry * instance()
Returns the instance pointer, creating the object on the first call.
QgsLayerTreeLayer * toLayer(QgsLayerTreeNode *node)
Cast node to a layer. No type checking is done - use isLayer() to find out whether this operation is ...
static QgsProject * instance()
Returns the QgsProject singleton instance.
void removeLayersFromRegistry(const QStringList &layerIds)
void setLayerInsertionPoint(QgsLayerTreeGroup *parentGroup, int index)
Set where the new layers should be inserted - can be used to follow current selection.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
bool isGroup(QgsLayerTreeNode *node)
Check whether the node is a valid group node.
Layer tree node points to a map layer.