QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsvaluemapsearchwidgetwrapper.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvaluemapsearchwidgetwrapper.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 QGSVALUEMAPSEARCHWIDGETWRAPPER_H
17 #define QGSVALUEMAPSEARCHWIDGETWRAPPER_H
18 
19 #include "qgssearchwidgetwrapper.h"
20 #include <QComboBox>
21 
29 {
30  Q_OBJECT
31  public:
32  explicit QgsValueMapSearchWidgetWrapper( QgsVectorLayer* vl, int fieldIdx, QWidget* parent = nullptr );
33  bool applyDirectly() override;
34  QString expression() override;
35  bool valid() const override;
36  FilterFlags supportedFlags() const override;
37  FilterFlags defaultFlags() const override;
38  virtual QString createExpression( FilterFlags flags ) const override;
39 
40  public slots:
41 
42  virtual void clearWidget() override;
43  virtual void setEnabled( bool enabled ) override;
44 
45  protected:
46  QWidget* createWidget( QWidget* parent ) override;
47  void initWidget( QWidget* editor ) override;
48 
49  protected slots:
50  void setExpression( QString exp ) override;
51 
52  private slots:
53  void comboBoxIndexChanged( int idx );
54 
55  private:
56  QComboBox * mComboBox;
57 };
58 
59 #endif // QGSVALUEMAPSEARCHWIDGETWRAPPER_H
Manages an editor widget Widget and wrapper share the same parent.
virtual QString createExpression(FilterFlags flags) const
Creates a filter expression based on the current state of the search widget and the specified filter ...
virtual void setEnabled(bool enabled) override
Toggles whether the search widget is enabled or disabled.
virtual void setExpression(QString value)=0
virtual QString expression()=0
Will be used to access the widget&#39;s value.
Wraps a value map search widget.
virtual void clearWidget()
Clears the widget&#39;s current value and resets it back to the default state.
virtual bool valid() const =0
Return true if the widget has been properly initialized.
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.
virtual bool applyDirectly()=0
If this is true, then this search widget should take effect directly when its expression changes...
virtual FilterFlags defaultFlags() const
Returns the filter flags which should be set by default for the search widget.
Represents a vector layer which manages a vector based data sets.
virtual FilterFlags supportedFlags() const
Returns filter flags supported by the search widget.