QGIS API Documentation  2.14.0-Essen
qgssearchwidgetwrapper.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssearchwidgetwrapper.h
3  --------------------------------------
4  Date : 31.5.2015
5  Copyright : (C) 2015 Karolina Alexiou (carolinux)
6  Email : carolinegr at gmail 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 QGSSEARCHWIDGETWRAPPER_H
17 #define QGSSEARCHWIDGETWRAPPER_H
18 
19 #include <QObject>
20 #include <QMap>
21 #include <QVariant>
22 
23 class QgsVectorLayer;
24 class QgsField;
25 
26 #include "qgseditorwidgetconfig.h"
28 #include "qgswidgetwrapper.h"
29 
40 class GUI_EXPORT QgsSearchWidgetWrapper : public QgsWidgetWrapper
41 {
42  Q_OBJECT
43  public:
51  explicit QgsSearchWidgetWrapper( QgsVectorLayer* vl, int fieldIdx, QWidget* parent = nullptr );
52 
62  virtual QString expression() = 0;
67  virtual bool applyDirectly() = 0;
68 
69  signals:
70 
75  void expressionChanged( const QString& exp );
76 
77  protected slots:
78 
79  virtual void setExpression( QString value ) = 0;
80  void setFeature( const QgsFeature& feature ) override;
81 
82  protected:
84  void clearExpression();
85 
87  int mFieldIdx;
88 
89 };
90 // We'll use this class inside a QVariant in the widgets properties
91 Q_DECLARE_METATYPE( QgsSearchWidgetWrapper* )
92 
93 #endif // QGSSEARCHWIDGETWRAPPER_H
Manages an editor widget Widget and wrapper share the same parent.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:187
virtual void setFeature(const QgsFeature &feature)=0
Is called, when the value of the widget needs to be changed.
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:44
Represents a vector layer which manages a vector based data sets.
Manages an editor widget Widget and wrapper share the same parent.