QGIS API Documentation 3.99.0-Master (7d2ca374f2d)
Loading...
Searching...
No Matches
qgsfeaturefilterwidget_p.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsfeaturefilterwidget.h
3 --------------------------------------
4 Date : 20.9.2019
5 Copyright : (C) 2019 Julien Cabieces
6 Email : julien dot cabieces 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
16#ifndef QGSFEATUREFILTERWIDGET_P_H
17#define QGSFEATUREFILTERWIDGET_P_H
18
19
21
22//
23// W A R N I N G
24// -------------
25//
26// This file is not part of the QGIS API. It exists purely as an
27// implementation detail. This header file may change from version to
28// version without notice, or even be removed.
29//
30
31#include "ui_qgsfeaturefilterwidget.h"
32
33#include "qgis_gui.h"
34#include "qgsattributeform.h"
35
36#include <QTimer>
37
38#define SIP_NO_FILE
39
40class QgsVectorLayer;
43class QgsDualView;
44class QgsMessageBar;
45
50class GUI_EXPORT QgsFeatureFilterWidget : public QWidget, private Ui::QgsFeatureFilterWidget
51{
52 Q_OBJECT
53
54 public:
56 explicit QgsFeatureFilterWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
57
58 void init( QgsVectorLayer *layer, const QgsAttributeEditorContext &context, QgsDualView *mainView, QgsMessageBar *messageBar, int messagebarTimeout );
59
64 void setFilterExpression( const QString &filterString, QgsAttributeForm::FilterType type = QgsAttributeForm::ReplaceFilter, bool alwaysShowFilter = false );
65
66 public slots:
67 void filterShowAll();
68 void filterSelected();
69 void filterInvalid();
70 void filterVisible();
71 void filterEdited();
72
73
74 private slots:
75
77 void columnBoxInit();
78
80 void storedFilterExpressionBoxInit();
82 void storeExpressionButtonInit();
83
84 void filterExpressionBuilder();
85 void filterQueryChanged( const QString &query );
86 void filterQueryAccepted();
87
91 void onFilterQueryTextChanged( const QString &value );
92
97 void handleStoreFilterExpression();
98
102 void saveAsStoredFilterExpression();
103
108 void editStoredFilterExpression();
109
114 void updateCurrentStoredFilterExpression();
115
116 void filterColumnChanged( QAction *filterAction );
117
118 private:
119 /* replace the search widget with a new one */
120 void replaceSearchWidget( QWidget *oldw, QWidget *neww );
121
122 QMenu *mFilterColumnsMenu = nullptr;
123 QMenu *mStoredFilterExpressionMenu = nullptr;
124 QTimer mFilterQueryTimer;
125 QgsSearchWidgetWrapper *mCurrentSearchWidgetWrapper = nullptr;
126 QgsDualView *mMainView = nullptr;
127 QgsVectorLayer *mLayer = nullptr;
128 QgsAttributeEditorContext mEditorContext;
129 QgsMessageBar *mMessageBar = nullptr;
130};
131
132#endif // QGSFEATUREFILTERWIDGET_P_H
133
Contains context information for attribute editor widgets.
FilterType
Filter types.
@ ReplaceFilter
Filter should replace any existing filter.
This widget is used to show the attributes of a set of features of a QgsVectorLayer.
Definition qgsdualview.h:47
A bar for displaying non-blocking messages to the user.
Shows a search widget on a filter form.
Represents a vector layer which manages a vector based dataset.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52