QGIS API Documentation  2.12.0-Lyon
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 
41 class GUI_EXPORT QgsSearchWidgetWrapper : public QgsWidgetWrapper
42 {
43  Q_OBJECT
44  public:
52  explicit QgsSearchWidgetWrapper( QgsVectorLayer* vl, int fieldIdx, QWidget* parent = 0 );
53 
63  virtual QString expression() = 0;
68  virtual bool applyDirectly() = 0;
69 
70  signals:
71 
76  void expressionChanged( QString exp );
77 
78  protected slots:
79 
80  virtual void setExpression( QString value ) = 0;
81  void setFeature( const QgsFeature& feature ) override;
82 
83  protected:
85  int mFieldIdx;
86 
87 };
88 // We'll use this class inside a QVariant in the widgets properties
90 
91 #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:176
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:40
Q_NOWARN_DEPRECATED_POP Q_DECLARE_METATYPE(QgsExpression::Interval)
Represents a vector layer which manages a vector based data sets.
Manages an editor widget Widget and wrapper share the same parent.