QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
Public Member Functions | List of all members
QgsAbstractGeocoderLocatorFilter Class Referenceabstract

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

#include <qgsabstractgeocoderlocatorfilter.h>

Inheritance diagram for QgsAbstractGeocoderLocatorFilter:
Inheritance graph
[legend]

Public Member Functions

 QgsAbstractGeocoderLocatorFilter (const QString &name, const QString &displayName, const QString &prefix, QgsGeocoderInterface *geocoder, const QgsRectangle &boundingBox=QgsRectangle())
 Constructor for QgsAbstractGeocoderLocatorFilter. More...
 
const QgsRectangle boundingBox ()
 Returns the WGS84 bounding box attached to the filter. More...
 
QString displayName () const override
 
void fetchResults (const QString &string, const QgsLocatorContext &context, QgsFeedback *feedback) override
 
QgsGeocoderInterfacegeocoder () const
 Returns the geocoder attached to the filter. More...
 
QgsLocatorResult geocoderResultToLocatorResult (const QgsGeocoderResult &result)
 Converts a geocoder result to a locator result. More...
 
QgsGeocoderResult locatorResultToGeocoderResult (const QgsLocatorResult &result) const
 Converts a locator result to a geocoder result. More...
 
QString name () const override
 
QString prefix () const override
 
void triggerResult (const QgsLocatorResult &result) override
 

Detailed Description

An abstract base class which implements a locator filter populated from a QgsGeocoderInterface.

This base 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.

Note
This is a low-level API, designed for use by client applications which do not utilize the QGIS gui library. Usually the concrete class QgsGeocoderLocatorFilter from the gui library should be used instead.
Since
QGIS 3.18

Definition at line 39 of file qgsabstractgeocoderlocatorfilter.h.

Constructor & Destructor Documentation

◆ QgsAbstractGeocoderLocatorFilter()

QgsAbstractGeocoderLocatorFilter::QgsAbstractGeocoderLocatorFilter ( const QString &  name,
const QString &  displayName,
const QString &  prefix,
QgsGeocoderInterface geocoder,
const QgsRectangle boundingBox = QgsRectangle() 
)

Constructor for QgsAbstractGeocoderLocatorFilter.

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 20 of file qgsabstractgeocoderlocatorfilter.cpp.

Member Function Documentation

◆ boundingBox()

const QgsRectangle QgsAbstractGeocoderLocatorFilter::boundingBox ( )
inline

Returns the WGS84 bounding box attached to the filter.

Definition at line 83 of file qgsabstractgeocoderlocatorfilter.h.

◆ displayName()

QString QgsAbstractGeocoderLocatorFilter::displayName ( ) const
override

Definition at line 35 of file qgsabstractgeocoderlocatorfilter.cpp.

◆ fetchResults()

void QgsAbstractGeocoderLocatorFilter::fetchResults ( const QString &  string,
const QgsLocatorContext context,
QgsFeedback feedback 
)
override

Definition at line 45 of file qgsabstractgeocoderlocatorfilter.cpp.

◆ geocoder()

QgsGeocoderInterface * QgsAbstractGeocoderLocatorFilter::geocoder ( ) const

Returns the geocoder attached to the filter.

Definition at line 68 of file qgsabstractgeocoderlocatorfilter.cpp.

◆ geocoderResultToLocatorResult()

QgsLocatorResult QgsAbstractGeocoderLocatorFilter::geocoderResultToLocatorResult ( const QgsGeocoderResult result)

Converts a geocoder result to a locator result.

See also
locatorResultToGeocoderResult()

Definition at line 86 of file qgsabstractgeocoderlocatorfilter.cpp.

◆ locatorResultToGeocoderResult()

QgsGeocoderResult QgsAbstractGeocoderLocatorFilter::locatorResultToGeocoderResult ( const QgsLocatorResult result) const

Converts a locator result to a geocoder result.

See also
geocoderResultToLocatorResult()

Definition at line 73 of file qgsabstractgeocoderlocatorfilter.cpp.

◆ name()

QString QgsAbstractGeocoderLocatorFilter::name ( ) const
override

Definition at line 30 of file qgsabstractgeocoderlocatorfilter.cpp.

◆ prefix()

QString QgsAbstractGeocoderLocatorFilter::prefix ( ) const
override

Definition at line 40 of file qgsabstractgeocoderlocatorfilter.cpp.

◆ triggerResult()

void QgsAbstractGeocoderLocatorFilter::triggerResult ( const QgsLocatorResult result)
override

Definition at line 62 of file qgsabstractgeocoderlocatorfilter.cpp.


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