QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
18 #ifndef QGSLOCATORFILTER_H
19 #define QGSLOCATORFILTER_H
26 #include "qgis_core.h"
53 , displayString( displayString )
54 , userData( userData )
94 QString group = QString();
117 , iconPath( iconPath )
130 QList<QgsLocatorResult::ResultAction>
actions;
167 Q_DECLARE_FLAGS( Flags, Flag )
185 virtual QString name()
const = 0;
191 virtual QString displayName()
const = 0;
196 virtual QgsLocatorFilter::Flags flags()
const;
215 virtual QString
prefix()
const {
return QString(); }
258 virtual void triggerResultFromAction(
const QgsLocatorResult &result,
const int actionId );
275 bool useWithoutPrefix()
const;
282 void setUseWithoutPrefix(
bool useWithoutPrefix );
290 QString activePrefix()
const;
298 void setActivePrefix(
const QString &activePrefix )
SIP_SKIP;
306 static bool stringMatches(
const QString &candidate,
const QString &search );
313 static double fuzzyScore(
const QString &candidate,
const QString &search );
319 bool enabled()
const;
325 void setEnabled(
bool enabled );
331 virtual bool hasConfigWidget()
const;
339 virtual void openConfigWidget( QWidget *parent =
nullptr );
365 bool mEnabled =
true;
366 bool mUseWithoutPrefix =
true;
367 QString mActivePrefifx = QString();
372 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsLocatorFilter::Flags )
375 #endif // QGSLOCATORFILTER_H
@ Highest
Highest priority.
virtual QString prefix() const
Returns the search prefix character(s) for this filter.
QString displayString
String displayed for result.
virtual Priority priority() const
Returns the priority for the filter, which controls how results are ordered in the locator.
QList< QgsLocatorResult::ResultAction > actions
Additional actions to be used in a locator widget for the given result.
ResultAction(int id, QString text, QString iconPath=QString())
Constructor for ResultAction The id used to recognized the action when the result is triggered.
virtual void clearPreviousResults()
This method will be called on main thread on the original filter (not a clone) before fetching result...
Q_DECLARE_METATYPE(QgsMeshTimeSettings)
virtual void prepare(const QString &string, const QgsLocatorContext &context)
Prepares the filter instance for an upcoming search for the specified string.
QgsLocatorResult(QgsLocatorFilter *filter, const QString &displayString, const QVariant &userData=QVariant())
Constructor for QgsLocatorResult.
Priority
Filter priority. Controls the order of results in the locator.
The ResultAction stores basic information for additional actions to be used in a locator widget for t...
QIcon icon
Icon for result.
Flag
Flags for locator behavior.
MessageLevel
Level for messages This will be used both for message log and message bar in application.
QString description
Descriptive text for result.
QVariant userData
Custom reference or other data set by the filter.