18 #ifndef QGSLOCATORFILTER_H 19 #define QGSLOCATORFILTER_H 21 #include "qgis_core.h" 51 , displayString( displayString )
52 , userData( userData )
92 QString group = QString();
127 Q_DECLARE_FLAGS( Flags,
Flag )
145 virtual QString name() const = 0;
151 virtual QString displayName() const = 0;
162 virtual
Priority priority()
const {
return Medium; }
175 virtual QString
prefix()
const {
return QString(); }
227 bool useWithoutPrefix()
const;
234 void setUseWithoutPrefix(
bool useWithoutPrefix );
242 QString activePrefix()
const;
250 void setActivePrefix(
const QString &activePrefix )
SIP_SKIP;
258 static bool stringMatches(
const QString &candidate,
const QString &search );
264 bool enabled()
const;
270 void setEnabled(
bool enabled );
276 virtual bool hasConfigWidget()
const;
284 virtual void openConfigWidget( QWidget *parent =
nullptr );
310 bool mEnabled =
true;
311 bool mUseWithoutPrefix =
true;
312 QString mActivePrefifx = QString();
317 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsLocatorFilter::Flags )
320 #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.
Q_DECLARE_METATYPE(QModelIndex)
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.
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 void clearPreviousResults()
This method will be called on main thread on the original filter (not a clone) before fetching result...
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.