QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsfilterlineedit.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsfilterlineedit.h
3  ------------------------
4  begin : October 27, 2012
5  copyright : (C) 2012 by Alexander Bruy
6  email : alexander dot bruy at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSFILTERLINEEDIT_H
19 #define QGSFILTERLINEEDIT_H
20 
21 #include <QLineEdit>
22 
23 class QToolButton;
24 
28 class GUI_EXPORT QgsFilterLineEdit : public QLineEdit
29 {
30  Q_OBJECT
31  public:
32  QgsFilterLineEdit( QWidget* parent = 0, QString nullValue = QString::null );
33 
34  void setNullValue( QString nullValue ) { mNullValue = nullValue; }
35 
36  signals:
37  void cleared();
38 
39  protected:
40  void resizeEvent( QResizeEvent * );
41  void changeEvent( QEvent * );
42 
43  private slots:
44  void clear();
45  void toggleClearButton( const QString &text );
46 
47  private:
48  QString mNullValue;
49  QToolButton *btnClear;
50 };
51 
52 #endif // QGSFILTERLINEEDIT_H