QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
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;
void logMessage(const QString &message, Qgis::MessageLevel level=Qgis::Info)
Logs a message to the log panel.
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.
Encapsulates properties of an individual matching result found by a QgsLocatorFilter.
bool enabled() const
Returns true if the filter is enabled.
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.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
void setEnabled(bool enabled)
Sets whether the filter is enabled.
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.
virtual QgsLocatorFilter::Flags flags() const
Returns flags which specify the filter's behavior.