QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
33 return QgsLocatorFilter::Flags();
44 return !search.isEmpty() && candidate.contains( search, Qt::CaseInsensitive );
74 return mUseWithoutPrefix;
87 if ( mActivePrefifx.isNull() )
90 return mActivePrefifx;
virtual QString prefix() const
Returns the search prefix character(s) for this filter.
virtual QString name() const =0
Returns the unique name for the filter.
virtual void openConfigWidget(QWidget *parent=nullptr)
Opens the configuration widget for the filter (if it has one), with the specified parent widget.
virtual bool hasConfigWidget() const
Should return true if the filter has a configuration widget.
QVariant getUserData() const
Returns the userData.
Encapsulates properties of an individual matching result found by a QgsLocatorFilter.
bool enabled() const
Returns true if the filter is enabled.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
static double fuzzyScore(const QString &candidate, const QString &search)
Tests a candidate string to see how likely it is a match for a specified search string.
static double fuzzyScore(const QString &candidate, const QString &search)
Tests a candidate string to see how likely it is a match for a specified search string.
MessageLevel
Level for messages This will be used both for message log and message bar in application.
void setEnabled(bool enabled)
Sets whether the filter is enabled.
void logMessage(const QString &message, Qgis::MessageLevel level=Qgis::MessageLevel::Info)
Logs a message to the log panel.
bool useWithoutPrefix() const
Returns true if the filter should be used when no prefix is entered.
void setActivePrefix(const QString &activePrefix)
Sets the prefix as being used by the locator.
QString activePrefix() const
Returns the prefix in use in the locator is entered.
virtual void triggerResultFromAction(const QgsLocatorResult &result, const int actionId)
Triggers a filter result from this filter for an entry in the context menu.
static bool stringMatches(const QString &candidate, const QString &search)
Tests a candidate string to see if it should be considered a match for a specified search string.
QgsLocatorFilter(QObject *parent=nullptr)
Constructor for QgsLocatorFilter.
void setUseWithoutPrefix(bool useWithoutPrefix)
Sets whether the filter should be used when no prefix is entered.
QVariant userData
Custom reference or other data set by the filter.
virtual QgsLocatorFilter::Flags flags() const
Returns flags which specify the filter's behavior.