|
QGIS API Documentation 3.99.0-Master (2fe06baccd8)
|
A layer tree view for elevation profiles. More...
#include <qgselevationprofilelayertreeview.h>

Public Slots | |
| void | addNodeForRegisteredSource (const QString &sourceId, const QString &sourceName) |
| Adds a custom node in the layer tree corresponding to a registered profile source. | |
| void | populateMissingLayers (QgsProject *project) |
| Adds any layers from a project which currently aren't within the profile's layer tree. | |
| void | removeNodeForUnregisteredSource (const QString &sourceId) |
| Removes a custom node from the layer tree corresponding to an unregistered profile source. | |
| Public Slots inherited from QgsLayerTreeViewBase | |
| void | collapseAllNodes () |
| Enhancement of QTreeView::collapseAll() that also records expanded state in layer tree nodes. | |
| void | expandAllNodes () |
| Enhancement of QTreeView::expandAll() that also records expanded state in layer tree nodes. | |
Signals | |
| void | addLayers (const QList< QgsMapLayer * > &layers) |
| Emitted when layers should be added to the profile, e.g. | |
Public Member Functions | |
| QgsElevationProfileLayerTreeView (QgsLayerTree *rootNode, QWidget *parent=nullptr) | |
Construct a new tree view with given layer tree (root node must not be nullptr). | |
| void | populateInitialSources (QgsProject *project) |
| Initially populates the tree view using layers from a project, as well as sources from the source registry. | |
| QgsElevationProfileLayerTreeProxyModel * | proxyModel () |
| Returns the view's proxy model. | |
| Public Member Functions inherited from QgsLayerTreeViewBase | |
| QgsLayerTreeViewBase (QWidget *parent=nullptr) | |
| Constructor for QgsLayerTreeViewBase. | |
| ~QgsLayerTreeViewBase () override | |
| QgsLayerTreeGroup * | currentGroupNode () const |
| Returns the current group node. | |
| QgsMapLayer * | currentLayer () const |
Returns the currently selected layer, or nullptr if no layers is selected. | |
| QgsLayerTreeModelLegendNode * | currentLegendNode () const |
| Gets current legend node. | |
| QgsLayerTreeNode * | currentNode () const |
| Returns the current node. | |
| QgsLayerTreeViewDefaultActions * | defaultActions () |
| Gets access to the default actions that may be used with the tree view. | |
| QgsLayerTreeModelLegendNode * | index2legendNode (const QModelIndex &index) const |
| Returns legend node for given view index. | |
| QgsLayerTreeNode * | index2node (const QModelIndex &index) const |
| Returns the layer tree node for given view index. | |
| QgsMapLayer * | layerForIndex (const QModelIndex &index) const |
| Returns the map layer corresponding to a view index. | |
| QgsLayerTreeModel * | layerTreeModel () const |
| Returns the associated layer tree model. | |
| QModelIndex | legendNode2index (QgsLayerTreeModelLegendNode *legendNode) |
| Returns the view index for a given legend node. | |
| QModelIndex | legendNode2sourceIndex (QgsLayerTreeModelLegendNode *legendNode) |
| Returns the layer tree source model index for a given legend node. | |
| void | mouseDoubleClickEvent (QMouseEvent *event) override |
| QModelIndex | node2index (QgsLayerTreeNode *node) const |
| Returns the view model index for a given node. | |
| QModelIndex | node2sourceIndex (QgsLayerTreeNode *node) const |
| Returns the layer tree source model index for a given node. | |
| QList< QgsLayerTreeLayer * > | selectedLayerNodes () const |
| Returns the list of selected nodes filtered to just layer nodes (QgsLayerTreeLayer). | |
| QList< QgsMapLayer * > | selectedLayers () const |
| Returns the list of selected layers. | |
| QList< QgsMapLayer * > | selectedLayersRecursive () const |
| Gets list of selected layers, including those that are not directly selected, but their ancestor groups is selected. | |
| QList< QgsLayerTreeModelLegendNode * > | selectedLegendNodes () const |
| Returns the list of selected legend nodes. | |
| QList< QgsLayerTreeNode * > | selectedNodes (bool skipInternal=false) const |
| Returns the list of selected layer tree nodes. | |
| void | setCurrentLayer (QgsMapLayer *layer) |
| Sets the currently selected layer. | |
| void | setCurrentNode (QgsLayerTreeNode *node) |
| Sets the currently selected node. | |
| void | setLayerTreeModel (QgsLayerTreeModel *model) |
| Associates a layer tree model with the view. | |
Static Public Attributes | |
| static const QString | CUSTOM_NODE_ELEVATION_PROFILE_SOURCE = QStringLiteral( "elevationProfileRegistry" ) |
Protected Member Functions | |
| void | resizeEvent (QResizeEvent *event) override |
| Protected Member Functions inherited from QgsLayerTreeViewBase | |
| QModelIndex | layerTreeModelIndexToViewIndex (const QModelIndex &index) const |
| Returns the layer tree model index corresponding with a view index. | |
| void | updateExpandedStateFromNode (QgsLayerTreeNode *node) |
| Updates the expanded state from a node. | |
| QModelIndex | viewIndexToLayerTreeModelIndex (const QModelIndex &index) const |
| Returns the view index corresponding with a layer tree model index. | |
Additional Inherited Members | |
| Protected Slots inherited from QgsLayerTreeViewBase | |
| void | onExpandedChanged (QgsLayerTreeNode *node, bool expanded) |
| Called when the expanded state changes for a node. | |
| void | onModelReset () |
| Called when the model is reset. | |
| void | updateExpandedStateToNode (const QModelIndex &index) |
| Stores the expanded state to a node with matching index. | |
| Protected Attributes inherited from QgsLayerTreeViewBase | |
| QgsLayerTreeViewDefaultActions * | mDefaultActions = nullptr |
| helper class with default actions. Lazily initialized. | |
A layer tree view for elevation profiles.
Definition at line 113 of file qgselevationprofilelayertreeview.h.
|
explicit |
Construct a new tree view with given layer tree (root node must not be nullptr).
The root node is not transferred by the view.
Definition at line 439 of file qgselevationprofilelayertreeview.cpp.
|
signal |
Emitted when layers should be added to the profile, e.g.
via a drag and drop action.
|
slot |
Adds a custom node in the layer tree corresponding to a registered profile source.
The created node can be accessed via the source id. If the source already has a corresponding node in the layer tree, a second node won't be created.
| sourceId | Unique identifier of the registered profile source. |
| sourceName | Name of the registered profile source. |
Definition at line 492 of file qgselevationprofilelayertreeview.cpp.
| void QgsElevationProfileLayerTreeView::populateInitialSources | ( | QgsProject * | project | ) |
Initially populates the tree view using layers from a project, as well as sources from the source registry.
Definition at line 481 of file qgselevationprofilelayertreeview.cpp.
|
slot |
Adds any layers from a project which currently aren't within the profile's layer tree.
Definition at line 452 of file qgselevationprofilelayertreeview.cpp.
| QgsElevationProfileLayerTreeProxyModel * QgsElevationProfileLayerTreeView::proxyModel | ( | ) |
Returns the view's proxy model.
Definition at line 509 of file qgselevationprofilelayertreeview.cpp.
|
slot |
Removes a custom node from the layer tree corresponding to an unregistered profile source.
| sourceId | Unique identifier of the unregistered profile source. |
Definition at line 504 of file qgselevationprofilelayertreeview.cpp.
|
overrideprotected |
Definition at line 514 of file qgselevationprofilelayertreeview.cpp.
|
static |
Definition at line 118 of file qgselevationprofilelayertreeview.h.