Class: QgsSearchWidgetToolButton

A tool button widget which is displayed next to search widgets in forms, and allows for controlling how the widget behaves and how the filtering/searching operates.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsSearchWidgetToolButton

Base classes

QToolButton

QAbstractButton

QWidget

QObject

QPaintDevice

class qgis.gui.QgsSearchWidgetToolButton[source]

Bases: QToolButton

__init__(parent: QWidget | None = None)

Constructor for QgsSearchWidgetToolButton.

Parameters:

parent (Optional[QWidget] = None) – parent object

activeFlags(self) QgsSearchWidgetWrapper.FilterFlags[source]

Returns the active filter flags shown in the widget.

See also

setActiveFlags()

See also

toggleFlag()

See also

availableFlags()

Return type:

QgsSearchWidgetWrapper.FilterFlags

signal activeFlagsChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

availableFlags(self) QgsSearchWidgetWrapper.FilterFlags[source]

Returns the available filter flags shown in the widget.

See also

activeFlags()

Return type:

QgsSearchWidgetWrapper.FilterFlags

isActive(self) bool[source]

Returns True if the widget is set to be included in the search.

See also

setInactive()

See also

setActive()

Return type:

bool

setActive(self)[source]

Sets the search widget as active by selecting the first available search type.

See also

isActive()

See also

setInactive()

setActiveFlags(self, flags: QgsSearchWidgetWrapper.FilterFlags | QgsSearchWidgetWrapper.FilterFlag)[source]

Sets the current active filter flags for the widget. Any flags which are not present in the available filter flags (see availableFlags()) will not be set.

Parameters:

flags (Union[QgsSearchWidgetWrapper.FilterFlags, QgsSearchWidgetWrapper.FilterFlag]) – active flags to show in widget

See also

toggleFlag()

See also

activeFlags()

setAvailableFlags(self, flags: QgsSearchWidgetWrapper.FilterFlags | QgsSearchWidgetWrapper.FilterFlag)[source]

Sets the available filter flags to show in the widget. Any active flags (see activeFlags()) which are not present in the new available filter flags will be cleared;

Parameters:

flags (Union[QgsSearchWidgetWrapper.FilterFlags, QgsSearchWidgetWrapper.FilterFlag]) – available flags to show in widget

See also

availableFlags()

See also

setActiveFlags()

setDefaultFlags(self, flags: QgsSearchWidgetWrapper.FilterFlags | QgsSearchWidgetWrapper.FilterFlag)[source]

Sets the default filter flags to show in the widget.

Parameters:

flags (Union[QgsSearchWidgetWrapper.FilterFlags, QgsSearchWidgetWrapper.FilterFlag]) – default flags to show in widget

See also

setActiveFlags()

setInactive(self)[source]

Sets the search widget as inactive, ie do not search the corresponding field.

See also

isActive()

See also

setActive()

toggleFlag(self, flag: QgsSearchWidgetWrapper.FilterFlag)[source]

Toggles an individual active filter flag for the widget. Any flags which are not present in the available filter flags (see availableFlags()) will be ignore. Other flags may be cleared if they conflict with the newly toggled flag.

Parameters:

flag (QgsSearchWidgetWrapper.FilterFlag) – flag to toggle

See also

setActiveFlags()

See also

activeFlags()