QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | List of all members
QgsLocatorResult Class Reference

Encapsulates properties of an individual matching result found by a QgsLocatorFilter. More...

#include <qgslocatorfilter.h>

Classes

struct  ResultAction
 The ResultAction stores basic information for additional actions to be used in a locator widget for the result. More...
 

Public Member Functions

 QgsLocatorResult ()=default
 Constructor for QgsLocatorResult.
 
 QgsLocatorResult (QgsLocatorFilter *filter, const QString &displayString, const QVariant &userData=QVariant())
 Constructor for QgsLocatorResult.
 
QVariant getUserData () const
 Returns the userData.
 
void setUserData (QVariant userData)
 Set userData for the locator result.
 

Public Attributes

QList< QgsLocatorResult::ResultActionactions
 Additional actions to be used in a locator widget for the given result.
 
QString description
 Descriptive text for result.
 
QString displayString
 String displayed for result.
 
QgsLocatorFilterfilter = nullptr
 Filter from which the result was obtained.
 
QString group
 Group the results by categories If left as empty string, this means that results are all shown without being grouped.
 
QIcon icon
 Icon for result.
 
double score = 0.5
 Match score, from 0 - 1, where 1 represents a perfect match.
 

Detailed Description

Encapsulates properties of an individual matching result found by a QgsLocatorFilter.

Since
QGIS 3.0

Definition at line 38 of file qgslocatorfilter.h.

Constructor & Destructor Documentation

◆ QgsLocatorResult() [1/2]

QgsLocatorResult::QgsLocatorResult ( )
default

Constructor for QgsLocatorResult.

◆ QgsLocatorResult() [2/2]

QgsLocatorResult::QgsLocatorResult ( QgsLocatorFilter filter,
const QString &  displayString,
const QVariant &  userData = QVariant() 
)
inline

Constructor for QgsLocatorResult.

Definition at line 50 of file qgslocatorfilter.h.

Member Function Documentation

◆ getUserData()

QVariant QgsLocatorResult::getUserData ( ) const

Returns the userData.

Since
QGIS 3.18

Definition at line 104 of file qgslocatorfilter.cpp.

◆ setUserData()

void QgsLocatorResult::setUserData ( QVariant  userData)

Set userData for the locator result.

Since
QGIS 3.34

Definition at line 109 of file qgslocatorfilter.cpp.

Member Data Documentation

◆ actions

QList<QgsLocatorResult::ResultAction> QgsLocatorResult::actions

Additional actions to be used in a locator widget for the given result.

They could be displayed in a context menu.

Since
QGIS 3.6

Definition at line 138 of file qgslocatorfilter.h.

◆ description

QString QgsLocatorResult::description

Descriptive text for result.

Definition at line 83 of file qgslocatorfilter.h.

◆ displayString

QString QgsLocatorResult::displayString

String displayed for result.

Definition at line 78 of file qgslocatorfilter.h.

◆ filter

QgsLocatorFilter* QgsLocatorResult::filter = nullptr

Filter from which the result was obtained.

This is automatically set.

Definition at line 73 of file qgslocatorfilter.h.

◆ group

QString QgsLocatorResult::group

Group the results by categories If left as empty string, this means that results are all shown without being grouped.

If a group is given, the results will be grouped by group under a header.

Note
This should be translated.
Since
QGIS 3.2

Definition at line 102 of file qgslocatorfilter.h.

◆ icon

QIcon QgsLocatorResult::icon

Icon for result.

Definition at line 88 of file qgslocatorfilter.h.

◆ score

double QgsLocatorResult::score = 0.5

Match score, from 0 - 1, where 1 represents a perfect match.

Definition at line 93 of file qgslocatorfilter.h.


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