QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
18 #ifndef QGSLOCATORWIDGET_H
19 #define QGSLOCATORWIDGET_H
28 #include <QFocusEvent>
29 #include <QHeaderView>
33 class QgsLocatorResultsView;
36 class QgsLocatorLineEdit;
74 void search(
const QString &
string );
80 void invalidateResults();
90 bool eventFilter( QObject *obj, QEvent *event )
override;
95 void triggerSearchAndShowList();
96 void configMenuAboutToShow();
97 void scheduleDelayedPopup();
99 void showContextMenu(
const QPoint &point );
103 QgsLocatorLineEdit *mLineEdit =
nullptr;
105 QgsLocatorResultsView *mResultsView =
nullptr;
107 QList<QMetaObject::Connection> mCanvasConnections;
108 QMenu *mMenu =
nullptr;
112 bool mHasSelectedResult =
false;
114 void acceptCurrentEntry();
128 QgsLocatorFilterFilter(
QgsLocatorWidget *widget, QObject *parent =
nullptr );
133 QString name()
const override {
return QStringLiteral(
"filters" );}
134 QString
displayName()
const override {
return QString(); }
149 class GUI_EXPORT QgsLocatorResultsView :
public QTreeView
158 QgsLocatorResultsView( QWidget *parent =
nullptr );
163 void recalculateSize();
168 void selectNextResult();
173 void selectPreviousResult();
188 explicit QgsLocatorLineEdit(
QgsLocatorWidget *locator, QWidget *parent =
nullptr );
191 bool performCompletion();
194 void paintEvent( QPaintEvent *event )
override;
198 QString mCompletionText =
nullptr;
206 #endif // QGSLOCATORWIDGET_H
Abstract base class for filters which collect locator results.
Handles the management of QgsLocatorFilter objects and async collection of search results from them.
virtual QgsLocatorFilter * clone() const =0
Creates a clone of the filter.
virtual Priority priority() const
Returns the priority for the filter, which controls how results are ordered in the locator.
Map canvas is a class for displaying all GIS data types on a canvas.
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
Encapsulates properties of an individual matching result found by a QgsLocatorFilter.
Encapsulates the properties relating to the context of a locator search.
The QgsLocatorModelBridge class provides the core functionality to be used in a locator widget.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
virtual QString displayName() const =0
Returns a translated, user-friendly name for the filter.
Priority
Filter priority. Controls the order of results in the locator.
virtual void fetchResults(const QString &string, const QgsLocatorContext &context, QgsFeedback *feedback)=0
Retrieves the filter results for a specified search string.
virtual void triggerResult(const QgsLocatorResult &result)=0
Triggers a filter result from this filter.