16 #ifndef QGSLAYERTREEVIEW_H 17 #define QGSLAYERTREEVIEW_H 54 if ( sipCpp->inherits(
"QgsLayerTreeView" ) )
55 sipType = sipType_QgsLayerTreeView;
70 void setModel( QAbstractItemModel *model )
override;
96 void setLayerVisible(
QgsMapLayer *layer,
bool visible );
122 QList<QgsLayerTreeNode *> selectedNodes(
bool skipInternal =
false )
const;
124 QList<QgsLayerTreeLayer *> selectedLayerNodes()
const;
127 QList<QgsMapLayer *> selectedLayers()
const;
135 QList<QgsMapLayer *> selectedLayersRecursive()
const;
163 QList<QgsLayerTreeViewIndicator *> indicators(
QgsLayerTreeNode *node )
const;
183 static QStringList viewOnlyCustomProperties()
SIP_SKIP;
188 void refreshLayerSymbology(
const QString &layerId );
194 void expandAllNodes();
200 void collapseAllNodes();
214 void contextMenuEvent( QContextMenuEvent *event )
override;
218 QgsMapLayer *layerForIndex(
const QModelIndex &index )
const;
220 void mouseReleaseEvent( QMouseEvent *event )
override;
221 void keyPressEvent( QKeyEvent *event )
override;
223 void dropEvent( QDropEvent *event )
override;
225 void resizeEvent( QResizeEvent *event )
override;
229 void modelRowsInserted(
const QModelIndex &index,
int start,
int end );
230 void modelRowsRemoved();
232 void updateExpandedStateToNode(
const QModelIndex &index );
234 void onCurrentChanged();
249 QHash< QgsLayerTreeNode *, QList<QgsLayerTreeViewIndicator *> >
mIndicators;
257 friend class QgsLayerTreeViewItemDelegate;
275 virtual QMenu *createContextMenu() = 0
SIP_FACTORY;
279 #endif // QGSLAYERTREEVIEW_H int layerMarkWidth() const
Returns width of contextual menu mark, at right of layer node items.
Layer tree group node serves as a container for layers and further groups.
Base class for all map layer types.
The QgsLayerTreeView class extends QTreeView and provides some additional functionality when working ...
int mLayerMarkWidth
Width of contextual menu mark for layer nodes.
QString mCurrentLayerID
Keeps track of current layer ID (to check when to emit signal about change of current layer) ...
The QgsLayerTreeViewDefaultActions class serves as a factory of actions that can be used together wit...
The QgsLayerTreeModel class is model implementation for Qt item views framework.
QPoint mLastReleaseMousePos
Used by the item delegate for identification of which indicator has been clicked. ...
QHash< QgsLayerTreeNode *, QList< QgsLayerTreeViewIndicator * > > mIndicators
Storage of indicators used with the tree view.
This class is a base class for nodes in a layer tree.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
QgsLayerTreeViewMenuProvider * menuProvider() const
Returns pointer to the context menu provider. May be nullptr.
The QgsLegendRendererItem class is abstract interface for legend items returned from QgsMapLayerLegen...
void setLayerMarkWidth(int width)
Set width of contextual menu mark, at right of layer node items.
Indicator that can be used in a layer tree view to display icons next to items of the layer tree...
Layer tree node points to a map layer.