21#include "moc_qgslocatorfilter.cpp"
45 return !search.isEmpty() && candidate.contains( search, Qt::CaseInsensitive );
75 return mUseWithoutPrefix;
88 if ( mActivePrefifx.isNull() )
91 return mActivePrefifx;
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 setActivePrefix(const QString &activePrefix)
Sets the prefix as being used by the locator.
virtual QgsLocatorFilter::Flags flags() const
Returns flags which specify the filter's behavior.
virtual QString prefix() const
Returns the search prefix character(s) for this filter.
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.
bool useWithoutPrefix() const
Returns true if the filter should be used when no prefix 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.
void setUseWithoutPrefix(bool useWithoutPrefix)
Sets whether the filter should be used when no prefix is entered.
void logMessage(const QString &message, Qgis::MessageLevel level=Qgis::MessageLevel::Info)
Logs a message to the log panel.
bool enabled() const
Returns true if the filter is enabled.
virtual void openConfigWidget(QWidget *parent=nullptr)
Opens the configuration widget for the filter (if it has one), with the specified parent widget.
QString activePrefix() const
Returns the prefix in use in the locator is entered.
virtual QString name() const =0
Returns the unique name for the filter.
QgsLocatorFilter(QObject *parent=nullptr)
Constructor for QgsLocatorFilter.
virtual bool hasConfigWidget() const
Should return true if the filter has a configuration widget.
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.
Encapsulates properties of an individual matching result found by a QgsLocatorFilter.
void setUserData(const QVariant &userData)
Set userData for the locator result.
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.