QGIS API Documentation 3.99.0-Master (26c88405ac0)
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
19#include "qgis_gui.h"
20#include "qgis_sip.h"
22
23#include <QToolButton>
24
25#ifdef SIP_RUN
26//%ModuleHeaderCode
28//%End
29#endif
30
38class GUI_EXPORT QgsSearchWidgetToolButton : public QToolButton
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
69
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 QgsSearchWidgetWrapper::FilterFlags mAvailableFilterFlags;
156 QgsSearchWidgetWrapper::FilterFlags mDefaultFilterFlags;
158 QMenu *mMenu = nullptr;
159
160 void updateState();
161};
162
163#endif // QGSSEARCHWIDGETTOOLBUTTON_H
QgsSearchWidgetWrapper::FilterFlags activeFlags() const
Returns the active filter flags shown in the widget.
void setDefaultFlags(QgsSearchWidgetWrapper::FilterFlags flags)
Sets the default filter flags to show in the widget.
void activeFlagsChanged(QgsSearchWidgetWrapper::FilterFlags flags)
Emitted when the active flags selected in the widget is changed.
QgsSearchWidgetToolButton(QWidget *parent=nullptr)
Constructor for QgsSearchWidgetToolButton.
void setAvailableFlags(QgsSearchWidgetWrapper::FilterFlags flags)
Sets the available filter flags to show in the widget.
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:199
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_END
Definition qgis_sip.h:216