Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Hugo Mercier
committed
Nov 3, 2015
1 parent
16def06
commit d16cdcf
Showing
34 changed files
with
991 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** \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(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.