QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsGeocoderLocatorFilter Class Reference

An adapter class which implements a locator filter populated from a QgsGeocoderInterface. More...

#include <qgsgeocoderlocatorfilter.h>

Inheritance diagram for QgsGeocoderLocatorFilter:
Inheritance graph
[legend]

Public Member Functions

 QgsGeocoderLocatorFilter (const QString &name, const QString &displayName, const QString &prefix, QgsGeocoderInterface *geocoder, QgsMapCanvas *canvas, const QgsRectangle &boundingBox=QgsRectangle())
 Constructor for QgsGeocoderLocatorFilter.
 
QgsLocatorFilterclone () const override SIP_FACTORY
 
- Public Member Functions inherited from QgsAbstractGeocoderLocatorFilter
 QgsAbstractGeocoderLocatorFilter (const QString &name, const QString &displayName, const QString &prefix, QgsGeocoderInterface *geocoder, const QgsRectangle &boundingBox=QgsRectangle())
 Constructor for QgsAbstractGeocoderLocatorFilter.
 
const QgsRectangle boundingBox ()
 Returns the WGS84 bounding box attached to the filter.
 
QString displayName () const override
 
void fetchResults (const QString &string, const QgsLocatorContext &context, QgsFeedback *feedback) override
 
QgsGeocoderInterfacegeocoder () const
 Returns the geocoder attached to the filter.
 
QgsLocatorResult geocoderResultToLocatorResult (const QgsGeocoderResult &result)
 Converts a geocoder result to a locator result.
 
QgsGeocoderResult locatorResultToGeocoderResult (const QgsLocatorResult &result) const
 Converts a locator result to a geocoder result.
 
QString name () const override
 
QString prefix () const override
 
void triggerResult (const QgsLocatorResult &result) override
 

Detailed Description

An adapter class which implements a locator filter populated from a QgsGeocoderInterface.

This class implements the required logic to bridge a class which implements the QgsGeocoderInterface interface to a QgsLocatorFilter. It allows easy creation of a locator filter from a geocoder.

Since
QGIS 3.18

Definition at line 34 of file qgsgeocoderlocatorfilter.h.

Constructor & Destructor Documentation

◆ QgsGeocoderLocatorFilter()

QgsGeocoderLocatorFilter::QgsGeocoderLocatorFilter ( const QString &  name,
const QString &  displayName,
const QString &  prefix,
QgsGeocoderInterface geocoder,
QgsMapCanvas canvas,
const QgsRectangle boundingBox = QgsRectangle() 
)

Constructor for QgsGeocoderLocatorFilter.

The name argument specifies a unique name for the filter. This should be an untranslated string identifying the filter.

The displayName argument must specify a translated, user-friendly name for the filter.

The prefix argument specifies the prefix character(s) for this filter. Prefixing a search with these characters will restrict the locator search to only include results from this filter. The prefix must consist of at least three characters.

The geocoder must specify an instance of a class which implements the QgsGeocoderInterface interface. Ownership of geocoder is not transferred, and the caller must ensure that geocoder exists for the lifetime of this filter.

The boundingBox argument specifies the geographic bounding box, in WGS84, covered by the filter.

Definition at line 22 of file qgsgeocoderlocatorfilter.cpp.

Member Function Documentation

◆ clone()

QgsLocatorFilter * QgsGeocoderLocatorFilter::clone ( ) const
override

Definition at line 29 of file qgsgeocoderlocatorfilter.cpp.


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