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

A tool button that allows enabling or disabling legend filter by contents of the map. More...

#include <qgslegendfilterbutton.h>

Inheritance diagram for QgsLegendFilterButton:
Inheritance graph
[legend]

Signals

void expressionTextChanged ()
 Emitted when the expression text changes.
 

Public Member Functions

 QgsLegendFilterButton (QWidget *parent=nullptr)
 Construct a new filter legend button.
 
QString expressionText () const
 Returns the current text used as filter expression.
 
void registerExpressionContextGenerator (QgsExpressionContextGenerator *generator)
 Register an expression context generator class that will be used to retrieve an expression context for the button when required.
 
void setExpressionText (const QString &expression)
 Sets the current text used as filter expression.
 
void setVectorLayer (QgsVectorLayer *layer)
 Sets the associated vectorLayer May be nullptr.
 
QgsVectorLayervectorLayer () const
 Returns the current associated vectorLayer May be nullptr.
 

Detailed Description

A tool button that allows enabling or disabling legend filter by contents of the map.

An additional pop down menu allows defining a boolean expression to refine the filtering.

Definition at line 32 of file qgslegendfilterbutton.h.

Constructor & Destructor Documentation

◆ QgsLegendFilterButton()

QgsLegendFilterButton::QgsLegendFilterButton ( QWidget *  parent = nullptr)

Construct a new filter legend button.

Parameters
parentThe parent QWidget

Definition at line 26 of file qgslegendfilterbutton.cpp.

Member Function Documentation

◆ expressionText()

QString QgsLegendFilterButton::expressionText ( ) const

Returns the current text used as filter expression.

Definition at line 118 of file qgslegendfilterbutton.cpp.

◆ expressionTextChanged

void QgsLegendFilterButton::expressionTextChanged ( )
signal

Emitted when the expression text changes.

◆ registerExpressionContextGenerator()

void QgsLegendFilterButton::registerExpressionContextGenerator ( QgsExpressionContextGenerator generator)

Register an expression context generator class that will be used to retrieve an expression context for the button when required.

Since
QGIS 3.32

Definition at line 91 of file qgslegendfilterbutton.cpp.

◆ setExpressionText()

void QgsLegendFilterButton::setExpressionText ( const QString &  expression)

Sets the current text used as filter expression.

This will update the menu

Definition at line 123 of file qgslegendfilterbutton.cpp.

◆ setVectorLayer()

void QgsLegendFilterButton::setVectorLayer ( QgsVectorLayer layer)

Sets the associated vectorLayer May be nullptr.

Definition at line 134 of file qgslegendfilterbutton.cpp.

◆ vectorLayer()

QgsVectorLayer * QgsLegendFilterButton::vectorLayer ( ) const

Returns the current associated vectorLayer May be nullptr.

Definition at line 129 of file qgslegendfilterbutton.cpp.


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