QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgsaggregatetoolbutton.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsaggregatetoolbutton.h
3 --------------------------------------
4 Date : Nov 2017
5 Copyright : (C) 2017 Matthias Kuhn
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
16#ifndef QGSAGGREGATETOOLBUTTON_H
17#define QGSAGGREGATETOOLBUTTON_H
18
19#include <QToolButton>
20#include <QVariant>
21
23#include "qgis_gui.h"
24
32class GUI_EXPORT QgsAggregateToolButton : public QToolButton
33{
34 Q_OBJECT
35
36 public:
37
42
46 void setType( QVariant::Type type );
47
51 QVariant::Type type() const;
52
56 void setActive( bool active );
57
61 bool active() const;
62
66 QString aggregate() const;
67
71 void setAggregate( const QString &aggregate );
72
73 signals:
74
79
84
85 private slots:
86 void aboutToShowMenu();
87
88 private:
89 void updateAvailableAggregates();
90 QMenu *mMenu = nullptr;
91 QVariant::Type mType = QVariant::Invalid;
92 bool mActive = false;
93 QString mAggregate;
94 QList<QgsAggregateCalculator::AggregateInfo> mAvailableAggregates;
95};
96
97#endif // QGSAGGREGATETOOLBUTTON_H
Offers a toolbutton to choose between different aggregate functions.
void activeChanged()
A function has been selected or deselected.
void aggregateChanged()
The function name of the selected aggregate has changed.