QGIS/python/gui/qgslegendfilterbutton.sip
Hugo Mercier d16cdcf449 Add more options for filtering legend elements
This introduces two new options to filter legend elements:
- filter by expression: a boolean expression can be set. Only symbols of
features that make the expression evaluated to true will be kept in the legend
- filter by polygon: only symbols of features that are inside the given
polygon will be part of the legend.

The polygon filtering is used in particular for a new option in the
composer legend that allows to filter out anything that is not included
in the current atlas polygon.
2015-11-03 10:39:09 +01:00

51 lines
1.2 KiB
Plaintext

/** \ingroup gui
* \class QgsFilterLegendButton
* A tool button that allows to enable or disable legend filter by contents of the map.
* An additional pop down menu allows to define a boolean expression to refine the filtering.
* @note added in 2.14
*/
class QgsLegendFilterButton: public QToolButton
{
%TypeHeaderCode
#include <qgslegendfilterbutton.h>
%End
public:
/**
* Construct a new filter legend button
*
* @param parent The parent QWidget
*/
QgsLegendFilterButton( QWidget* parent = 0 );
~QgsLegendFilterButton();
/**
* Returns the current text used as filter expression
*/
QString expressionText() const;
/**
* Sets the current text used as filter expression.
* This will update the menu
*/
void setExpressionText( const QString& expression );
/**
* Returns the current associated vectorLayer
* May be null
*/
QgsVectorLayer* vectorLayer() const;
/**
* Sets the associated vectorLayer
* May be null
*/
void setVectorLayer( QgsVectorLayer* layer );
signals:
/**
* Emitted when the expression text changes
*/
void expressionTextChanged();
};