QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
QgsMapCanvasUtils Class Reference

Utility functions for working with QgsMapCanvas widgets. More...

#include <qgsmapcanvasutils.h>

Static Public Member Functions

static QString filterForLayer (QgsMapCanvas *canvas, QgsVectorLayer *layer)
 Constructs a filter to use for selecting features from the given layer, in order to apply filters which prevent some features from being displayed (e.g.
static long flashMatchingFeatures (QgsMapCanvas *canvas, QgsVectorLayer *layer, const QString &filter)
 Flashes features from the specified layer which match the given filter expression string with a map canvas.
static long zoomToMatchingFeatures (QgsMapCanvas *canvas, QgsVectorLayer *layer, const QString &filter)
 Zooms a map canvas to features from the specified layer which match the given filter expression string.

Detailed Description

Utility functions for working with QgsMapCanvas widgets.

Since
QGIS 3.14

Definition at line 31 of file qgsmapcanvasutils.h.

Member Function Documentation

◆ filterForLayer()

QString QgsMapCanvasUtils::filterForLayer ( QgsMapCanvas * canvas,
QgsVectorLayer * layer )
static

Constructs a filter to use for selecting features from the given layer, in order to apply filters which prevent some features from being displayed (e.g.

as a result of temporal range of the canvas and the layer's temporal settings).

Will return an empty string if no filtering is required, or "\c false" if ALL features are filtered out by the canvas.

Since
QGIS 3.26

Definition at line 76 of file qgsmapcanvasutils.cpp.

◆ flashMatchingFeatures()

long QgsMapCanvasUtils::flashMatchingFeatures ( QgsMapCanvas * canvas,
QgsVectorLayer * layer,
const QString & filter )
static

Flashes features from the specified layer which match the given filter expression string with a map canvas.

The total count of matching features will be returned.

Definition at line 54 of file qgsmapcanvasutils.cpp.

◆ zoomToMatchingFeatures()

long QgsMapCanvasUtils::zoomToMatchingFeatures ( QgsMapCanvas * canvas,
QgsVectorLayer * layer,
const QString & filter )
static

Zooms a map canvas to features from the specified layer which match the given filter expression string.

The total count of matching features will be returned.

Definition at line 23 of file qgsmapcanvasutils.cpp.


The documentation for this class was generated from the following files: