QGIS/python/core/auto_generated/layertree/qgslayertreegroup.sip.in

235 lines
7.0 KiB
Plaintext
Raw Normal View History

2017-04-12 18:14:35 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layertree/qgslayertreegroup.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsLayerTreeGroup : QgsLayerTreeNode
{
2017-04-12 18:14:35 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Layer tree group node serves as a container for layers and further groups.
2017-04-12 18:14:35 +10:00
2017-12-15 10:36:55 -04:00
Group names do not need to be unique within one tree nor within one parent.
2017-04-12 18:14:35 +10:00
.. versionadded:: 2.4
%End
2017-04-12 18:14:35 +10:00
%TypeHeaderCode
#include "qgslayertreegroup.h"
%End
public:
2017-04-12 18:14:35 +10:00
QgsLayerTreeGroup( const QString &name = QString(), bool checked = true );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor
2017-04-12 18:14:35 +10:00
%End
virtual QString name() const;
2017-04-20 13:48:50 +02:00
2017-04-12 18:14:35 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the group's name.
2017-04-12 18:14:35 +10:00
%End
virtual void setName( const QString &n );
2017-04-20 13:48:50 +02:00
2017-04-12 18:14:35 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the group's name.
2017-04-12 18:14:35 +10:00
%End
QgsLayerTreeGroup *insertGroup( int index, const QString &name );
%Docstring
2017-12-15 10:36:55 -04:00
Insert a new group node with given name at specified position. The newly created node is owned by this group.
2017-04-12 18:14:35 +10:00
%End
QgsLayerTreeGroup *addGroup( const QString &name );
%Docstring
2017-12-15 10:36:55 -04:00
Append a new group node with given name. Newly created node is owned by this group.
2017-04-12 18:14:35 +10:00
%End
QgsLayerTreeLayer *insertLayer( int index, QgsMapLayer *layer );
%Docstring
2017-12-15 10:36:55 -04:00
Insert a new layer node for given map layer at specified position. The newly created node is owned by this group.
2017-04-12 18:14:35 +10:00
%End
QgsLayerTreeLayer *addLayer( QgsMapLayer *layer );
%Docstring
2017-12-15 10:36:55 -04:00
Append a new layer node for given map layer. The newly created node is owned by this group.
2017-04-12 18:14:35 +10:00
%End
void insertChildNodes( int index, const QList<QgsLayerTreeNode *> &nodes /Transfer/ );
%Docstring
2017-12-15 10:36:55 -04:00
Insert existing nodes at specified position. The nodes must not have a parent yet. The nodes will be owned by this group.
2017-04-12 18:14:35 +10:00
%End
void insertChildNode( int index, QgsLayerTreeNode *node /Transfer/ );
%Docstring
2017-12-15 10:36:55 -04:00
Insert existing node at specified position. The node must not have a parent yet. The node will be owned by this group.
2017-04-12 18:14:35 +10:00
%End
void addChildNode( QgsLayerTreeNode *node /Transfer/ );
%Docstring
2017-12-15 10:36:55 -04:00
Append an existing node. The node must not have a parent yet. The node will be owned by this group.
2017-04-12 18:14:35 +10:00
%End
void removeChildNode( QgsLayerTreeNode *node );
%Docstring
2017-12-15 10:36:55 -04:00
Remove a child node from this group. The node will be deleted.
2017-04-12 18:14:35 +10:00
%End
void removeLayer( QgsMapLayer *layer );
%Docstring
2017-12-15 10:36:55 -04:00
Remove map layer's node from this group. The node will be deleted.
2017-04-12 18:14:35 +10:00
%End
void removeChildren( int from, int count );
2017-04-12 18:14:35 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Remove child nodes from index "from". The nodes will be deleted.
2017-04-12 18:14:35 +10:00
%End
void removeChildrenGroupWithoutLayers();
2017-04-12 18:14:35 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Remove all child group nodes without layers. The groupnodes will be deleted.
2017-04-12 18:14:35 +10:00
%End
void removeAllChildren();
2017-04-12 18:14:35 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Remove all child nodes. The nodes will be deleted.
2017-04-12 18:14:35 +10:00
%End
QgsLayerTreeLayer *findLayer( QgsMapLayer *layer ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Find layer node representing the map layer. Searches recursively the whole sub-tree.
2017-04-12 18:14:35 +10:00
.. versionadded:: 3.0
%End
QgsLayerTreeLayer *findLayer( const QString &layerId ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Find layer node representing the map layer specified by its ID. Searches recursively the whole sub-tree.
2017-04-12 18:14:35 +10:00
%End
QList<QgsLayerTreeLayer *> findLayers() const;
%Docstring
2017-12-15 10:36:55 -04:00
Find all layer nodes. Searches recursively the whole sub-tree.
2017-04-12 18:14:35 +10:00
%End
QStringList findLayerIds() const;
2017-04-12 18:14:35 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Find layer IDs used in all layer nodes. Searches recursively the whole sub-tree.
2017-04-12 18:14:35 +10:00
%End
QgsLayerTreeGroup *findGroup( const QString &name );
%Docstring
2017-12-15 10:36:55 -04:00
Find group node with specified name. Searches recursively the whole sub-tree.
2018-08-02 11:51:38 +02:00
%End
QList<QgsLayerTreeGroup *> findGroups() const;
%Docstring
Find all group layer nodes
2017-04-12 18:14:35 +10:00
%End
static QgsLayerTreeGroup *readXml( QDomElement &element, const QgsReadWriteContext &context ) /Factory/;
2017-04-12 18:14:35 +10:00
%Docstring
Read group (tree) from XML element <layer-tree-group> and return the newly created group (or ``None`` on error).
2017-12-15 10:36:55 -04:00
Does not resolve textual references to layers. Call resolveReferences() afterwards to do it.
2017-04-12 18:14:35 +10:00
%End
static QgsLayerTreeGroup *readXml( QDomElement &element, const QgsProject *project, const QgsReadWriteContext &context ) /Factory/;
2017-04-12 18:14:35 +10:00
%Docstring
Read group (tree) from XML element <layer-tree-group> and return the newly created group (or ``None`` on error).
2017-12-15 10:36:55 -04:00
Also resolves textual references to layers from the project (calls resolveReferences() internally).
2017-04-12 18:14:35 +10:00
.. versionadded:: 3.0
%End
virtual void writeXml( QDomElement &parentElement, const QgsReadWriteContext &context );
2017-04-12 18:14:35 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Write group (tree) as XML element <layer-tree-group> and add it to the given parent element
2017-04-12 18:14:35 +10:00
%End
void readChildrenFromXml( QDomElement &element, const QgsReadWriteContext &context );
2017-04-12 18:14:35 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Read children from XML and append them to the group.
Does not resolve textual references to layers. Call resolveReferences() afterwards to do it.
2017-04-12 18:14:35 +10:00
%End
virtual QString dump() const;
2017-04-12 18:14:35 +10:00
%Docstring
Returns text representation of the tree. For debugging purposes only.
2017-04-12 18:14:35 +10:00
%End
2017-04-12 18:14:35 +10:00
virtual QgsLayerTreeGroup *clone() const /Factory/;
2017-04-12 18:14:35 +10:00
%Docstring
Returns a clone of the group. The children are cloned too.
2017-04-12 18:14:35 +10:00
%End
virtual void resolveReferences( const QgsProject *project, bool looseMatching = false );
2017-04-12 18:14:35 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Calls resolveReferences() on child tree nodes
2017-04-12 18:14:35 +10:00
.. versionadded:: 3.0
%End
virtual void setItemVisibilityCheckedRecursive( bool checked );
2017-04-12 18:14:35 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Check or uncheck a node and all its children (taking into account exclusion rules)
2017-04-12 18:14:35 +10:00
%End
bool isMutuallyExclusive() const;
2017-04-12 18:14:35 +10:00
%Docstring
Returns whether the group is mutually exclusive (only one child can be checked at a time)
2017-12-15 10:36:55 -04:00
2017-04-12 18:14:35 +10:00
.. versionadded:: 2.12
%End
void setIsMutuallyExclusive( bool enabled, int initialChildIndex = -1 );
2017-04-12 18:14:35 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Set whether the group is mutually exclusive (only one child can be checked at a time).
The initial child index determines which child should be initially checked. The default value
of -1 will determine automatically (either first one currently checked or none)
2017-04-12 18:14:35 +10:00
.. versionadded:: 2.12
%End
protected slots:
2017-04-12 18:14:35 +10:00
void nodeVisibilityChanged( QgsLayerTreeNode *node );
protected:
void updateChildVisibilityMutuallyExclusive();
2017-04-12 18:14:35 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Set check state of children - if mutually exclusive
2017-04-12 18:14:35 +10:00
%End
private:
2017-04-12 18:14:35 +10:00
QgsLayerTreeGroup( const QgsLayerTreeGroup &other );
%Docstring
2017-12-15 10:36:55 -04:00
Copies are not allowed
%End
};
2017-04-12 18:14:35 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layertree/qgslayertreegroup.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/