QGIS API Documentation 3.41.0-Master (cea29feecf2)
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#define SIP_NO_FILE
20
22
23//
24// W A R N I N G
25// -------------
26//
27// This file is not part of the QGIS API. It exists purely as an
28// implementation detail. This header file may change from version to
29// version without notice, or even be removed.
30//
31
32#include "ui_qgsfeaturefilterwidget.h"
33
34#include "qgsattributeform.h"
35
36#include "qgis_gui.h"
37#include <QTimer>
38
39class QgsVectorLayer;
42class QgsDualView;
43class QgsMessageBar;
44
49class GUI_EXPORT QgsFeatureFilterWidget : public QWidget, private Ui::QgsFeatureFilterWidget
50{
51 Q_OBJECT
52
53 public:
55 explicit QgsFeatureFilterWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
56
57 void init( QgsVectorLayer *layer, const QgsAttributeEditorContext &context, QgsDualView *mainView, QgsMessageBar *messageBar, int messagebarTimeout );
58
63 void setFilterExpression( const QString &filterString, QgsAttributeForm::FilterType type = QgsAttributeForm::ReplaceFilter, bool alwaysShowFilter = false );
64
65 public slots:
66 void filterShowAll();
67 void filterSelected();
68 void filterInvalid();
69 void filterVisible();
70 void filterEdited();
71
72
73 private slots:
74
76 void columnBoxInit();
77
79 void storedFilterExpressionBoxInit();
81 void storeExpressionButtonInit();
82
83 void filterExpressionBuilder();
84 void filterQueryChanged( const QString &query );
85 void filterQueryAccepted();
86
90 void onFilterQueryTextChanged( const QString &value );
91
96 void handleStoreFilterExpression();
97
101 void saveAsStoredFilterExpression();
102
107 void editStoredFilterExpression();
108
113 void updateCurrentStoredFilterExpression();
114
115 void filterColumnChanged( QAction *filterAction );
116
117 private:
118 /* replace the search widget with a new one */
119 void replaceSearchWidget( QWidget *oldw, QWidget *neww );
120
121 QMenu *mFilterColumnsMenu = nullptr;
122 QMenu *mStoredFilterExpressionMenu = nullptr;
123 QTimer mFilterQueryTimer;
124 QgsSearchWidgetWrapper *mCurrentSearchWidgetWrapper = nullptr;
125 QgsDualView *mMainView = nullptr;
126 QgsVectorLayer *mLayer = nullptr;
127 QgsAttributeEditorContext mEditorContext;
128 QgsMessageBar *mMessageBar = nullptr;
129};
130
131#endif // QGSFEATUREFILTERWIDGET_P_H
132
This class 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:45
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 data sets.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53