QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
Class that runs a hit test with given map settings. More...
#include <qgsmaphittest.h>
Public Types | |
typedef QMap< QString, QString > | LayerFilterExpression |
Maps an expression string to a layer id. | |
Public Member Functions | |
QgsMapHitTest (const QgsLayerTreeFilterSettings &settings) | |
Constructor based off layer tree filter settings. | |
QgsMapHitTest (const QgsMapSettings &settings, const QgsGeometry &polygon=QgsGeometry(), const QgsMapHitTest::LayerFilterExpression &layerFilterExpression=QgsMapHitTest::LayerFilterExpression()) | |
QgsMapHitTest (const QgsMapSettings &settings, const QgsMapHitTest::LayerFilterExpression &layerFilterExpression) | |
Constructor version used with only expressions to filter symbols (no extent or polygon intersection) | |
bool | legendKeyVisible (const QString &ruleKey, QgsVectorLayer *layer) const |
Tests whether a given legend key is visible for a specified layer. | |
QMap< QString, QSet< QString > > | results () const |
Returns the hit test results, which are a map of layer ID to visible symbol legend keys. | |
void | run () |
Runs the map hit test. | |
PRIVATE bool | symbolVisible (QgsSymbol *symbol, QgsVectorLayer *layer) const |
Tests whether a symbol is visible for a specified layer. | |
Friends | |
class | QgsMapHitTestTask |
Class that runs a hit test with given map settings.
Based on the hit test it returns which symbols will be visible on the map - this is useful for content based legend.
Definition at line 42 of file qgsmaphittest.h.
typedef QMap<QString, QString> QgsMapHitTest::LayerFilterExpression |
Maps an expression string to a layer id.
Definition at line 46 of file qgsmaphittest.h.
QgsMapHitTest::QgsMapHitTest | ( | const QgsMapSettings & | settings, |
const QgsGeometry & | polygon = QgsGeometry() , |
||
const QgsMapHitTest::LayerFilterExpression & | layerFilterExpression = QgsMapHitTest::LayerFilterExpression() |
||
) |
settings | Map settings used to evaluate symbols |
polygon | Polygon geometry to refine the hit test |
layerFilterExpression | Expression string for each layer id to evaluate in order to refine the symbol selection |
Definition at line 30 of file qgsmaphittest.cpp.
QgsMapHitTest::QgsMapHitTest | ( | const QgsMapSettings & | settings, |
const QgsMapHitTest::LayerFilterExpression & | layerFilterExpression | ||
) |
Constructor version used with only expressions to filter symbols (no extent or polygon intersection)
Definition at line 37 of file qgsmaphittest.cpp.
QgsMapHitTest::QgsMapHitTest | ( | const QgsLayerTreeFilterSettings & | settings | ) |
Constructor based off layer tree filter settings.
Definition at line 44 of file qgsmaphittest.cpp.
bool QgsMapHitTest::legendKeyVisible | ( | const QString & | ruleKey, |
QgsVectorLayer * | layer | ||
) | const |
Tests whether a given legend key is visible for a specified layer.
ruleKey | legend rule key |
layer | vector layer |
Definition at line 131 of file qgsmaphittest.cpp.
QMap< QString, QSet< QString > > QgsMapHitTest::results | ( | ) | const |
Returns the hit test results, which are a map of layer ID to visible symbol legend keys.
Definition at line 102 of file qgsmaphittest.cpp.
void QgsMapHitTest::run | ( | ) |
Runs the map hit test.
Definition at line 50 of file qgsmaphittest.cpp.
PRIVATE bool QgsMapHitTest::symbolVisible | ( | QgsSymbol * | symbol, |
QgsVectorLayer * | layer | ||
) | const |
Tests whether a symbol is visible for a specified layer.
symbol | symbol to find |
layer | vector layer |
Definition at line 119 of file qgsmaphittest.cpp.
|
friend |
Definition at line 143 of file qgsmaphittest.h.