QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgssearchwidgettoolbutton.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssearchwidgettoolbutton.h
3 ---------------------------
4 Date : May 2016
5 Copyright : (C) 2016 Nyall Dawson
6 Email : nyall dot dawson at gmail.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
16#ifndef QGSSEARCHWIDGETTOOLBUTTON_H
17#define QGSSEARCHWIDGETTOOLBUTTON_H
18
20#include "qgis_sip.h"
21#include <QToolButton>
22#include "qgis_gui.h"
23
24#ifdef SIP_RUN
25% ModuleHeaderCode
27% End
28#endif
29
37class GUI_EXPORT QgsSearchWidgetToolButton : public QToolButton
38{
39
40#ifdef SIP_RUN
42 if ( qobject_cast<QgsSearchWidgetToolButton *>( sipCpp ) )
43 sipType = sipType_QgsSearchWidgetToolButton;
44 else
45 sipType = nullptr;
47#endif
48
49 Q_OBJECT
50
51 public:
52
57 explicit QgsSearchWidgetToolButton( QWidget *parent SIP_TRANSFERTHIS = nullptr );
58
68 void setAvailableFlags( QgsSearchWidgetWrapper::FilterFlags flags );
69
76 void setDefaultFlags( QgsSearchWidgetWrapper::FilterFlags flags );
77
83 QgsSearchWidgetWrapper::FilterFlags availableFlags() const { return mAvailableFilterFlags; }
84
94 void setActiveFlags( QgsSearchWidgetWrapper::FilterFlags flags );
95
105 void toggleFlag( QgsSearchWidgetWrapper::FilterFlag flag );
106
113 QgsSearchWidgetWrapper::FilterFlags activeFlags() const { return mFilterFlags; }
114
120 bool isActive() const;
121
122 public slots:
123
129 void setInactive();
130
136 void setActive();
137
138 signals:
139
145
146 private slots:
147
148 void aboutToShowMenu();
149
150 void actionSelected();
151
152 void searchWidgetValueChanged();
153
154 private:
155
156 QgsSearchWidgetWrapper::FilterFlags mAvailableFilterFlags;
157 QgsSearchWidgetWrapper::FilterFlags mDefaultFilterFlags;
159 QMenu *mMenu = nullptr;
160
161 void updateState();
162
163};
164
165#endif // QGSSEARCHWIDGETTOOLBUTTON_H
A tool button widget which is displayed next to search widgets in forms, and allows for controlling h...
QgsSearchWidgetWrapper::FilterFlags activeFlags() const
Returns the active filter flags shown in the widget.
void activeFlagsChanged(QgsSearchWidgetWrapper::FilterFlags flags)
Emitted when the active flags selected in the widget is changed.
QgsSearchWidgetWrapper::FilterFlags availableFlags() const
Returns the available filter flags shown in the widget.
FilterFlag
Flags which indicate what types of filtering and searching is possible using the widget.
QFlags< FilterFlag > FilterFlags
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition qgis_sip.h:191
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_END
Definition qgis_sip.h:208