QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
|
A tool button that allows enabling or disabling legend filter by contents of the map. More...
#include <qgslegendfilterbutton.h>
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 . | |
QgsVectorLayer * | vectorLayer () const |
Returns the current associated vectorLayer May be nullptr . | |
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.
QgsLegendFilterButton::QgsLegendFilterButton | ( | QWidget * | parent = nullptr | ) |
Construct a new filter legend button.
parent | The parent QWidget |
Definition at line 25 of file qgslegendfilterbutton.cpp.
QString QgsLegendFilterButton::expressionText | ( | ) | const |
Returns the current text used as filter expression.
Definition at line 117 of file qgslegendfilterbutton.cpp.
|
signal |
Emitted when the expression text changes.
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.
Definition at line 90 of file qgslegendfilterbutton.cpp.
void QgsLegendFilterButton::setExpressionText | ( | const QString & | expression | ) |
Sets the current text used as filter expression.
This will update the menu
Definition at line 122 of file qgslegendfilterbutton.cpp.
void QgsLegendFilterButton::setVectorLayer | ( | QgsVectorLayer * | layer | ) |
Sets the associated vectorLayer May be nullptr
.
Definition at line 133 of file qgslegendfilterbutton.cpp.
QgsVectorLayer * QgsLegendFilterButton::vectorLayer | ( | ) | const |
Returns the current associated vectorLayer May be nullptr
.
Definition at line 128 of file qgslegendfilterbutton.cpp.