mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-17 00:09:36 -04:00
[locators] Add a description property to locator filter base class (#42132)
This commit is contained in:
parent
c1da9b0806
commit
2008f5ef57
@ -138,6 +138,13 @@ Returns the unique name for the filter. This should be an untranslated string id
|
||||
Returns a translated, user-friendly name for the filter.
|
||||
|
||||
.. seealso:: :py:func:`name`
|
||||
%End
|
||||
|
||||
virtual QString description() const;
|
||||
%Docstring
|
||||
Returns a translated, description for the filter.
|
||||
|
||||
.. versionadded:: 3.20
|
||||
%End
|
||||
|
||||
virtual QgsLocatorFilter::Flags flags() const;
|
||||
|
@ -198,6 +198,12 @@ class CORE_EXPORT QgsLocatorFilter : public QObject
|
||||
*/
|
||||
virtual QString displayName() const = 0;
|
||||
|
||||
/**
|
||||
* Returns a translated, description for the filter.
|
||||
* \since QGIS 3.20
|
||||
*/
|
||||
virtual QString description() const { return QString(); }
|
||||
|
||||
/**
|
||||
* Returns flags which specify the filter's behavior.
|
||||
*/
|
||||
|
@ -47,6 +47,9 @@ class test_filter(QgsLocatorFilter):
|
||||
def displayName(self):
|
||||
return 'test_' + self.identifier
|
||||
|
||||
def description(self):
|
||||
return 'test_description'
|
||||
|
||||
def prefix(self):
|
||||
return self._prefix
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user