2012-11-01 21:00:01 +02:00
|
|
|
|
|
|
|
/** LineEdit with builtin clear button
|
|
|
|
*/
|
|
|
|
class QgsFilterLineEdit : QLineEdit
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsfilterlineedit.h>
|
|
|
|
%End
|
|
|
|
public:
|
2014-10-20 15:47:10 +02:00
|
|
|
QgsFilterLineEdit( QWidget* parent = 0, QString nullValue = QString::null );
|
|
|
|
|
|
|
|
void setNullValue( QString nullValue );
|
|
|
|
|
|
|
|
QString nullValue() const;
|
2012-11-01 21:00:01 +02:00
|
|
|
|
2014-09-23 14:38:40 +02:00
|
|
|
/**
|
|
|
|
* Sets the current text with NULL support
|
|
|
|
*
|
|
|
|
* @param value The text to set. If a Null string is provided, the text will match the nullValue.
|
|
|
|
*/
|
|
|
|
void setValue( QString value );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the text of this edit with NULL support
|
|
|
|
*
|
|
|
|
* @return Current text (Null string if it matches the nullValue property )
|
|
|
|
*/
|
|
|
|
QString value() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine if the current text represents Null.
|
|
|
|
*
|
|
|
|
* @return True if the value is Null.
|
|
|
|
*/
|
|
|
|
bool isNull() const;
|
2014-05-27 23:22:50 +02:00
|
|
|
|
2013-06-23 16:00:16 +02:00
|
|
|
signals:
|
|
|
|
void cleared();
|
|
|
|
|
2014-09-23 14:38:40 +02:00
|
|
|
/**
|
|
|
|
* Same as textChanged(const QString& ) but with support for Null values.
|
|
|
|
*
|
|
|
|
* @param value The current text or Null string if it matches the nullValue property.
|
|
|
|
*/
|
|
|
|
void valueChanged( const QString& value );
|
|
|
|
|
2014-10-20 15:47:10 +02:00
|
|
|
protected:
|
|
|
|
void mousePressEvent( QMouseEvent* e );
|
|
|
|
void focusInEvent( QFocusEvent* e );
|
|
|
|
void resizeEvent( QResizeEvent* e );
|
|
|
|
void changeEvent( QEvent* e );
|
|
|
|
void paintEvent( QPaintEvent* e );
|
2012-11-01 21:00:01 +02:00
|
|
|
};
|