QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
Contains settings relating to filtering the contents of QgsLayerTreeModel and views. More...
#include <qgslayertreefiltersettings.h>
Public Member Functions | |
QgsLayerTreeFilterSettings (const QgsLayerTreeFilterSettings &other) | |
QgsLayerTreeFilterSettings (const QgsMapSettings &settings) | |
Constructor for QgsLayerTreeFilterSettings, using the specified map settings. | |
~QgsLayerTreeFilterSettings () | |
void | addVisibleExtentForLayer (QgsMapLayer *layer, const QgsReferencedGeometry &polygon) |
Adds a visible extent polygon for a map layer. | |
QgsGeometry | combinedVisibleExtentForLayer (const QgsMapLayer *layer) |
Returns the combined visible extent for a layer. | |
QgsGeometry | filterPolygon () const |
Returns the optional filter polygon, used when testing for symbols to show in the legend. | |
Qgis::LayerTreeFilterFlags | flags () const |
Returns the filter flags. | |
QString | layerFilterExpression (const QString &layerId) const |
Returns the filter expression to use for the layer with the specified layerId, or an empty string if no expression is set for the layer. | |
QMap< QString, QString > | layerFilterExpressions () const |
Returns the map of layer IDs to legend filter expression. | |
QList< QgsMapLayer * > | layers () const |
Returns the layers which should be shown in the legend. | |
QgsMapSettings & | mapSettings () |
Returns the map settings used to filter the legend content. | |
QgsLayerTreeFilterSettings & | operator= (const QgsLayerTreeFilterSettings &other) |
void | setFilterPolygon (const QgsGeometry &polygon) |
Sets the optional filter polygon, used when testing for symbols to show in the legend. | |
void | setFlags (Qgis::LayerTreeFilterFlags flags) |
Sets the filter flags. | |
void | setLayerFilterExpressions (const QMap< QString, QString > &expressions) |
Sets the map of layer IDs to legend filter expression. | |
void | setLayerFilterExpressionsFromLayerTree (QgsLayerTree *tree) |
Sets layer filter expressions using a layer tree. | |
Contains settings relating to filtering the contents of QgsLayerTreeModel and views.
Definition at line 39 of file qgslayertreefiltersettings.h.
|
explicit |
Constructor for QgsLayerTreeFilterSettings, using the specified map settings.
Definition at line 25 of file qgslayertreefiltersettings.cpp.
|
default |
QgsLayerTreeFilterSettings::QgsLayerTreeFilterSettings | ( | const QgsLayerTreeFilterSettings & | other | ) |
Definition at line 33 of file qgslayertreefiltersettings.cpp.
void QgsLayerTreeFilterSettings::addVisibleExtentForLayer | ( | QgsMapLayer * | layer, |
const QgsReferencedGeometry & | polygon | ||
) |
Adds a visible extent polygon for a map layer.
If layer is already included in the layers contained within mapSettings() (or previously added by calling this method) then this polygon extent will be unioned with the existing extent.
The layer will be appended to the list of layers to use during the legend hit test. (See layers()).
Definition at line 111 of file qgslayertreefiltersettings.cpp.
QgsGeometry QgsLayerTreeFilterSettings::combinedVisibleExtentForLayer | ( | const QgsMapLayer * | layer | ) |
Returns the combined visible extent for a layer.
The combined visible extent includes:
The returned geometry will always be in the layer's CRS.
Definition at line 128 of file qgslayertreefiltersettings.cpp.
QgsGeometry QgsLayerTreeFilterSettings::filterPolygon | ( | ) | const |
Returns the optional filter polygon, used when testing for symbols to show in the legend.
The CRS of the polygon will match the destination CRS of mapSettings().
If not set then the filter visibility extent will use the extent of mapSettings().
Definition at line 91 of file qgslayertreefiltersettings.cpp.
Qgis::LayerTreeFilterFlags QgsLayerTreeFilterSettings::flags | ( | ) | const |
Returns the filter flags.
Definition at line 101 of file qgslayertreefiltersettings.cpp.
QString QgsLayerTreeFilterSettings::layerFilterExpression | ( | const QString & | layerId | ) | const |
Returns the filter expression to use for the layer with the specified layerId, or an empty string if no expression is set for the layer.
Definition at line 86 of file qgslayertreefiltersettings.cpp.
QMap< QString, QString > QgsLayerTreeFilterSettings::layerFilterExpressions | ( | ) | const |
Returns the map of layer IDs to legend filter expression.
Definition at line 60 of file qgslayertreefiltersettings.cpp.
QList< QgsMapLayer * > QgsLayerTreeFilterSettings::layers | ( | ) | const |
Returns the layers which should be shown in the legend.
This includes all layers from the mapSettings() and any additional layers added by calls to addVisibleExtentForLayer().
Definition at line 165 of file qgslayertreefiltersettings.cpp.
QgsMapSettings & QgsLayerTreeFilterSettings::mapSettings | ( | ) |
Returns the map settings used to filter the legend content.
Definition at line 55 of file qgslayertreefiltersettings.cpp.
QgsLayerTreeFilterSettings & QgsLayerTreeFilterSettings::operator= | ( | const QgsLayerTreeFilterSettings & | other | ) |
Definition at line 44 of file qgslayertreefiltersettings.cpp.
void QgsLayerTreeFilterSettings::setFilterPolygon | ( | const QgsGeometry & | polygon | ) |
Sets the optional filter polygon, used when testing for symbols to show in the legend.
The CRS of the polygon must match the destination CRS of mapSettings().
If not set then the filter visibility extent will use the extent of mapSettings().
Definition at line 96 of file qgslayertreefiltersettings.cpp.
void QgsLayerTreeFilterSettings::setFlags | ( | Qgis::LayerTreeFilterFlags | flags | ) |
Sets the filter flags.
Definition at line 106 of file qgslayertreefiltersettings.cpp.
void QgsLayerTreeFilterSettings::setLayerFilterExpressions | ( | const QMap< QString, QString > & | expressions | ) |
Sets the map of layer IDs to legend filter expression.
Definition at line 65 of file qgslayertreefiltersettings.cpp.
void QgsLayerTreeFilterSettings::setLayerFilterExpressionsFromLayerTree | ( | QgsLayerTree * | tree | ) |
Sets layer filter expressions using a layer tree.
Definition at line 70 of file qgslayertreefiltersettings.cpp.