18 #ifndef QGSLOCATORFILTER_H 19 #define QGSLOCATORFILTER_H 21 #include "qgis_core.h" 51 , displayString( displayString )
52 , userData( userData )
114 Q_DECLARE_FLAGS( Flags,
Flag )
131 virtual QString name()
const = 0;
137 virtual QString displayName()
const = 0;
142 virtual QgsLocatorFilter::Flags flags()
const;
159 virtual QString
prefix()
const {
return QString(); }
201 bool useWithoutPrefix()
const;
208 void setUseWithoutPrefix(
bool useWithoutPrefix );
216 static bool stringMatches(
const QString &candidate,
const QString &search );
222 bool enabled()
const;
228 void setEnabled(
bool enabled );
234 virtual bool hasConfigWidget()
const;
242 virtual void openConfigWidget( QWidget *parent =
nullptr );
259 bool mEnabled =
true;
260 bool mUseWithoutPrefix =
true;
265 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsLocatorFilter::Flags )
268 #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.
Q_DECLARE_METATYPE(QModelIndex)
Flag
Flags for locator behavior.
Base class for feedback objects to be used for cancelation of something running in a worker thread...
QVariant userData
Custom reference or other data set by the filter.
QString displayString
String displayed for result.
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...
virtual QString prefix() const
Returns the search prefix character(s) for this filter.
QgsLocatorResult(QgsLocatorFilter *filter, const QString &displayString, const QVariant &userData=QVariant())
Constructor for QgsLocatorResult.