QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
QgsLocatorWidget Class Reference

A special locator widget which allows searching for matching results from a QgsLocator and presenting them to users for selection. More...

#include <qgslocatorwidget.h>

Inheritance diagram for QgsLocatorWidget:
Inheritance graph
[legend]

Public Slots

void invalidateResults ()
 Invalidates the current search results, e.g.
 
void search (const QString &string)
 Triggers the locator widget to focus, open and start searching for a specified string.
 

Signals

void configTriggered ()
 Emitted when the configure option is triggered in the widget.
 

Public Member Functions

 QgsLocatorWidget (QWidget *parent SIP_TRANSFERTHIS=nullptr)
 Constructor for QgsLocatorWidget.
 
QgsLocatorlocator ()
 Returns a pointer to the locator utilized by this widget.
 
void setMapCanvas (QgsMapCanvas *canvas)
 Sets a map canvas to associate with the widget.
 
void setPlaceholderText (const QString &text)
 Set placeholder text for the line edit.
 
void setResultContainerAnchors (QgsFloatingWidget::AnchorPoint anchorPoint, QgsFloatingWidget::AnchorPoint anchorWidgetPoint)
 Sets the result container anchorPoint and anchorWidgetPoint position.
 

Static Public Attributes

static const QgsSettingsEntryIntegersettingLocatorTreeHeight
 
static QgsSettingsTreeNodesTreeGuiLocator = QgsSettingsTree::sTreeGui->createChildNode( QStringLiteral( "locator" ) )
 

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *event) override
 

Detailed Description

A special locator widget which allows searching for matching results from a QgsLocator and presenting them to users for selection.

See also
QgsLocator

Definition at line 47 of file qgslocatorwidget.h.

Constructor & Destructor Documentation

◆ QgsLocatorWidget()

PRIVATE QgsLocatorWidget::QgsLocatorWidget ( QWidget *parent  SIP_TRANSFERTHIS = nullptr)

Constructor for QgsLocatorWidget.

Definition at line 39 of file qgslocatorwidget.cpp.

Member Function Documentation

◆ configTriggered

void QgsLocatorWidget::configTriggered ( )
signal

Emitted when the configure option is triggered in the widget.

◆ eventFilter()

bool QgsLocatorWidget::eventFilter ( QObject *  obj,
QEvent *  event 
)
overrideprotected

Definition at line 252 of file qgslocatorwidget.cpp.

◆ invalidateResults

void QgsLocatorWidget::invalidateResults ( )
slot

Invalidates the current search results, e.g.

as a result of changes to the locator filter settings.

Definition at line 184 of file qgslocatorwidget.cpp.

◆ locator()

QgsLocator * QgsLocatorWidget::locator ( )

Returns a pointer to the locator utilized by this widget.

Definition at line 129 of file qgslocatorwidget.cpp.

◆ search

void QgsLocatorWidget::search ( const QString &  string)
slot

Triggers the locator widget to focus, open and start searching for a specified string.

Definition at line 167 of file qgslocatorwidget.cpp.

◆ setMapCanvas()

void QgsLocatorWidget::setMapCanvas ( QgsMapCanvas canvas)

Sets a map canvas to associate with the widget.

This allows the widget to customize the searches performed by its locator(), such as prioritizing results which are near the current canvas extent.

Definition at line 134 of file qgslocatorwidget.cpp.

◆ setPlaceholderText()

void QgsLocatorWidget::setPlaceholderText ( const QString &  text)

Set placeholder text for the line edit.

Since
QGIS 3.36

Definition at line 156 of file qgslocatorwidget.cpp.

◆ setResultContainerAnchors()

void QgsLocatorWidget::setResultContainerAnchors ( QgsFloatingWidget::AnchorPoint  anchorPoint,
QgsFloatingWidget::AnchorPoint  anchorWidgetPoint 
)

Sets the result container anchorPoint and anchorWidgetPoint position.

Since
QGIS 3.36

Definition at line 161 of file qgslocatorwidget.cpp.

Member Data Documentation

◆ settingLocatorTreeHeight

const QgsSettingsEntryInteger* QgsLocatorWidget::settingLocatorTreeHeight
static

Definition at line 55 of file qgslocatorwidget.h.

◆ sTreeGuiLocator

QgsSettingsTreeNode* QgsLocatorWidget::sTreeGuiLocator = QgsSettingsTree::sTreeGui->createChildNode( QStringLiteral( "locator" ) )
inlinestatic

Definition at line 54 of file qgslocatorwidget.h.


The documentation for this class was generated from the following files: