QGIS API Documentation 3.41.0-Master (d5b93354e9c)
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#ifdef SIP_RUN
41 if ( qobject_cast<QgsSearchWidgetToolButton *>( sipCpp ) )
42 sipType = sipType_QgsSearchWidgetToolButton;
43 else
44 sipType = nullptr;
46#endif
47
48 Q_OBJECT
49
50 public:
55 explicit QgsSearchWidgetToolButton( QWidget *parent SIP_TRANSFERTHIS = nullptr );
56
66 void setAvailableFlags( QgsSearchWidgetWrapper::FilterFlags flags );
67
74 void setDefaultFlags( QgsSearchWidgetWrapper::FilterFlags flags );
75
81 QgsSearchWidgetWrapper::FilterFlags availableFlags() const { return mAvailableFilterFlags; }
82
92 void setActiveFlags( QgsSearchWidgetWrapper::FilterFlags flags );
93
103 void toggleFlag( QgsSearchWidgetWrapper::FilterFlag flag );
104
111 QgsSearchWidgetWrapper::FilterFlags activeFlags() const { return mFilterFlags; }
112
118 bool isActive() const;
119
120 public slots:
121
127 void setInactive();
128
134 void setActive();
135
136 signals:
137
143
144 private slots:
145
146 void aboutToShowMenu();
147
148 void actionSelected();
149
150 void searchWidgetValueChanged();
151
152 private:
153 QgsSearchWidgetWrapper::FilterFlags mAvailableFilterFlags;
154 QgsSearchWidgetWrapper::FilterFlags mDefaultFilterFlags;
156 QMenu *mMenu = nullptr;
157
158 void updateState();
159};
160
161#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