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 );
312 bool enabled()
const;
318 void setEnabled(
bool enabled );
324 virtual bool hasConfigWidget()
const;
332 virtual void openConfigWidget( QWidget *parent =
nullptr );
358 bool mEnabled =
true;
359 bool mUseWithoutPrefix =
true;
360 QString mActivePrefifx = QString();
365 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsLocatorFilter::Flags )
368 #endif // QGSLOCATORFILTER_H virtual void prepare(const QString &string, const QgsLocatorContext &context)
Prepares the filter instance for an upcoming search for the specified string.
QIcon icon
Icon for result.
Priority
Filter priority. Controls the order of results in the locator.
QString description
Descriptive text for result.
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Flag
Flags for locator behavior.
Base class for feedback objects to be used for cancellation of something running in a worker thread...
QVariant userData
Custom reference or other data set by the filter.
QString displayString
String displayed for result.
Q_DECLARE_METATYPE(QgsMeshTimeSettings)
Encapsulates the properties relating to the context of a locator search.
Encapsulates properties of an individual matching result found by a QgsLocatorFilter.
Abstract base class for filters which collect locator results.
virtual Priority priority() const
Returns the priority for the filter, which controls how results are ordered in the locator...
ResultAction(int id, QString text, QString iconPath=QString())
Constructor for ResultAction The id used to recognized the action when the result is triggered...
QList< QgsLocatorResult::ResultAction > actions
Additional actions to be used in a locator widget for the given result.
virtual QString prefix() const
Returns the search prefix character(s) for this filter.
virtual void clearPreviousResults()
This method will be called on main thread on the original filter (not a clone) before fetching result...
The ResultAction stores basic information for additional actions to be used in a locator widget for t...
QgsLocatorResult(QgsLocatorFilter *filter, const QString &displayString, const QVariant &userData=QVariant())
Constructor for QgsLocatorResult.