16 #ifndef QGSLAYERTREEVIEW_H
17 #define QGSLAYERTREEVIEW_H
36 #include <QSortFilterProxyModel>
60 void setFilterText(
const QString &filterText = QString() );
65 bool showPrivateLayers()
const;
70 void setShowPrivateLayers(
bool showPrivate );
74 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
82 bool mShowPrivateLayers =
false;
108 if ( sipCpp->inherits(
"QgsLayerTreeView" ) )
109 sipType = sipType_QgsLayerTreeView;
124 void setModel( QAbstractItemModel *model )
override;
218 void setLayerVisible(
QgsMapLayer *layer,
bool visible );
244 QList<QgsLayerTreeNode *> selectedNodes(
bool skipInternal =
false )
const;
246 QList<QgsLayerTreeLayer *> selectedLayerNodes()
const;
249 QList<QgsMapLayer *> selectedLayers()
const;
257 QList<QgsMapLayer *> selectedLayersRecursive()
const;
285 QList<QgsLayerTreeViewIndicator *> indicators(
QgsLayerTreeNode *node )
const;
305 static QStringList viewOnlyCustomProperties()
SIP_SKIP;
310 void refreshLayerSymbology( const QString &layerId );
316 void expandAllNodes();
322 void collapseAllNodes();
329 void setLayerMarkWidth(
int width ) { mLayerMarkWidth = width; }
341 void setShowPrivateLayers(
bool showPrivate );
347 bool showPrivateLayers( );
354 void contextMenuEvent( QContextMenuEvent *event )
override;
358 QgsMapLayer *layerForIndex(
const QModelIndex &index )
const;
360 void mouseReleaseEvent( QMouseEvent *event )
override;
361 void keyPressEvent( QKeyEvent *event )
override;
363 void dropEvent( QDropEvent *event )
override;
365 void resizeEvent( QResizeEvent *event )
override;
369 void modelRowsInserted(
const QModelIndex &index,
int start,
int end );
370 void modelRowsRemoved();
372 void updateExpandedStateToNode(
const QModelIndex &index );
374 void onCurrentChanged();
381 void onHorizontalScroll(
int value );
383 void onDataChanged(
const QModelIndex &topLeft,
const QModelIndex &bottomRight,
const QVector<int> &roles );
393 QHash< QgsLayerTreeNode *, QList<QgsLayerTreeViewIndicator *> >
mIndicators;
405 bool mShowPrivateLayers =
false;
411 friend class QgsLayerTreeViewItemDelegate;
429 virtual QMenu *createContextMenu() = 0
SIP_FACTORY;
433 #endif // QGSLAYERTREEVIEW_H