QGIS API Documentation  2.12.0-Lyon
qgsdefaultsearchwidgetwrapper.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsdefaultsearchwidgetwrapper.h
3  --------------------------------------
4  Date : 21.5.2015
5  Copyright : (C) 2015 Karolina Alexiou
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 QGSDEFAULTSEARCHWIDGETWRAPPER_H
17 #define QGSDEFAULTSEARCHWIDGETWRAPPER_H
18 
19 #include "qgssearchwidgetwrapper.h"
20 #include <qgsfilterlineedit.h>
21 
22 #include <QCheckBox>
23 
30 {
31  Q_OBJECT
32  public:
33  explicit QgsDefaultSearchWidgetWrapper( QgsVectorLayer* vl, int fieldIdx, QWidget* parent = 0 );
34 
35  // QgsSearchWidgetWrapper interface
36  public:
37  QString expression() override;
38  bool applyDirectly() override;
39 
40  protected slots:
41  void setExpression( QString exp ) override;
42 
43  private slots:
44  void setCaseString( int caseSensitiveCheckState );
45  void filterChanged();
46 
47  protected:
48  QWidget* createWidget( QWidget* parent ) override;
49  void initWidget( QWidget* editor ) override;
50  bool valid() override;
51 
52  private:
53  QgsFilterLineEdit* mLineEdit;
54  QCheckBox* mCheckbox;
55  QWidget* mContainer;
56  QString mCaseString;
57 };
58 
59 #endif // QGSDEFAULTSEARCHWIDGETWRAPPER_H
virtual bool valid()=0
Return true if the widget has been properly initialized.
Manages an editor widget Widget and wrapper share the same parent.
virtual void setExpression(QString value)=0
virtual QString expression()=0
Will be used to access the widget's value.
virtual QWidget * createWidget(QWidget *parent)=0
This method should create a new widget with the provided parent.
virtual void initWidget(QWidget *editor)
This method should initialize the editor widget with runtime data.
Lineedit with builtin clear button.
virtual bool applyDirectly()=0
If this is true, then this search widget should take effect directly when its expression changes...
Represents a vector layer which manages a vector based data sets.