QgsSearchWidgetToolButton class

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.

Constructors, destructors, conversion operators

QgsSearchWidgetToolButton(QWidget* parent = nullptr) explicit
Constructor for QgsSearchWidgetToolButton.

Public functions

auto activeFlags() const -> QgsSearchWidgetWrapper::FilterFlags
Returns the active filter flags shown in the widget.
auto availableFlags() const -> QgsSearchWidgetWrapper::FilterFlags
Returns the available filter flags shown in the widget.
auto isActive() const -> bool
Returns true if the widget is set to be included in the search.
void setActiveFlags(QgsSearchWidgetWrapper::FilterFlags flags)
Sets the current active filter flags for the widget.
void setAvailableFlags(QgsSearchWidgetWrapper::FilterFlags flags)
Sets the available filter flags to show in the widget.
void setDefaultFlags(QgsSearchWidgetWrapper::FilterFlags flags)
Sets the default filter flags to show in the widget.
void toggleFlag(QgsSearchWidgetWrapper::FilterFlag flag)
Toggles an individual active filter flag for the widget.

Signals

void activeFlagsChanged(QgsSearchWidgetWrapper::FilterFlags flags)
Emitted when the active flags selected in the widget is changed.

Public slots

void setActive()
Sets the search widget as active by selecting the first available search type.
void setInactive()
Sets the search widget as inactive, ie do not search the corresponding field.

Function documentation

QgsSearchWidgetToolButton::QgsSearchWidgetToolButton(QWidget* parent = nullptr) explicit

Constructor for QgsSearchWidgetToolButton.

Parameters
parent parent object

QgsSearchWidgetWrapper::FilterFlags QgsSearchWidgetToolButton::activeFlags() const

Returns the active filter flags shown in the widget.

QgsSearchWidgetWrapper::FilterFlags QgsSearchWidgetToolButton::availableFlags() const

Returns the available filter flags shown in the widget.

bool QgsSearchWidgetToolButton::isActive() const

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

void QgsSearchWidgetToolButton::setActiveFlags(QgsSearchWidgetWrapper::FilterFlags flags)

Sets the current active filter flags for the widget.

Parameters
flags active flags to show in widget

Any flags which are not present in the available filter flags (see availableFlags()) will not be set.

void QgsSearchWidgetToolButton::setAvailableFlags(QgsSearchWidgetWrapper::FilterFlags flags)

Sets the available filter flags to show in the widget.

Parameters
flags available flags to show in widget

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

void QgsSearchWidgetToolButton::setDefaultFlags(QgsSearchWidgetWrapper::FilterFlags flags)

Sets the default filter flags to show in the widget.

Parameters
flags default flags to show in widget

void QgsSearchWidgetToolButton::toggleFlag(QgsSearchWidgetWrapper::FilterFlag flag)

Toggles an individual active filter flag for the widget.

Parameters
flag flag to toggle

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.

void QgsSearchWidgetToolButton::activeFlagsChanged(QgsSearchWidgetWrapper::FilterFlags flags) signal

Emitted when the active flags selected in the widget is changed.

Parameters
flags active flags

void QgsSearchWidgetToolButton::setActive() public slot

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

void QgsSearchWidgetToolButton::setInactive() public slot

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