QGIS API Documentation
3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
src
gui
qgslegendfilterbutton.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgslegendfilterbutton.h - QToolButton for legend filter by map content
3
--------------------------------------
4
Date : June 2015
5
Copyright : (C) 2015 by Hugo Mercier at Oslandia
6
Email : hugo dot mercier at oslandia dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
#ifndef QGS_LEGEND_FILTER_BUTTON_H
16
#define QGS_LEGEND_FILTER_BUTTON_H
17
18
#include <QToolButton>
19
#include "qgis_gui.h"
20
#include "
qgsexpressioncontext.h
"
21
22
class
QgsVectorLayer
;
23
class
QgsExpressionContextGenerator
;
24
33
class
GUI_EXPORT
QgsLegendFilterButton
:
public
QToolButton
34
{
35
Q_OBJECT
36
37
public
:
38
44
QgsLegendFilterButton
( QWidget *parent =
nullptr
);
45
49
QString expressionText()
const
;
50
55
void
setExpressionText(
const
QString &expression );
56
62
void
registerExpressionContextGenerator(
QgsExpressionContextGenerator
*generator );
63
68
QgsVectorLayer
*vectorLayer()
const
;
69
74
void
setVectorLayer(
QgsVectorLayer
*layer );
75
76
signals:
77
81
void
expressionTextChanged
();
82
83
private
:
84
QMenu *mMenu =
nullptr
;
85
QAction *mSetExpressionAction =
nullptr
;
86
QAction *mClearExpressionAction =
nullptr
;
87
QString mExpression;
88
QgsExpressionContextGenerator
*mExpressionContextGenerator =
nullptr
;
89
90
void
updateMenu();
91
92
QgsVectorLayer
*mLayer =
nullptr
;
93
private
slots:
94
void
onSetLegendFilterExpression();
95
void
onClearFilterExpression();
96
void
onToggle(
bool
);
97
};
98
99
#endif
// QGS_FILTER_LEGEND_BUTTON_H
QgsExpressionContextGenerator
Abstract interface for generating an expression context.
Definition
qgsexpressioncontextgenerator.h:37
QgsLegendFilterButton
A tool button that allows enabling or disabling legend filter by contents of the map.
Definition
qgslegendfilterbutton.h:34
QgsLegendFilterButton::expressionTextChanged
void expressionTextChanged()
Emitted when the expression text changes.
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition
qgsvectorlayer.h:400
qgsexpressioncontext.h
Generated on Mon Oct 30 2023 18:42:25 for QGIS API Documentation by
1.9.8