QGIS API Documentation
2.12.0-Lyon
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
src
gui
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
Q_PROPERTY(
QString
nullValue READ nullValue WRITE setNullValue )
32
33
public
:
34
QgsFilterLineEdit
(
QWidget
* parent = 0,
const
QString
& nullValue = QString::null );
35
36
void
setNullValue
(
const
QString
& nullValue ) { mNullValue = nullValue; }
37
38
QString
nullValue
()
const
{
return
mNullValue; }
39
45
void
setValue
(
const
QString
& value ) {
setText
( value.
isNull
() ? mNullValue : value ); }
46
52
QString
value
()
const
{
return
isNull
() ? QString::null :
text
(); }
53
59
inline
bool
isNull
()
const
{
return
text
() == mNullValue; }
60
61
signals:
62
void
cleared();
63
69
void
valueChanged(
const
QString
& value );
70
71
protected
:
72
void
mousePressEvent
(
QMouseEvent
* e )
override
;
73
void
focusInEvent
(
QFocusEvent
* e )
override
;
74
void
resizeEvent
(
QResizeEvent
* e )
override
;
75
void
changeEvent
(
QEvent
* e )
override
;
76
void
paintEvent
(
QPaintEvent
* e )
override
;
77
78
private
slots:
79
void
clear
();
80
void
onTextChanged(
const
QString
&text );
81
82
private
:
83
QString
mNullValue;
84
QToolButton
*btnClear;
85
QString
mStyleSheet;
86
bool
mFocusInEvent;
87
};
88
89
#endif // QGSFILTERLINEEDIT_H
QEvent
QResizeEvent
QWidget
QLineEdit::clear
void clear()
QLineEdit::setText
void setText(const QString &)
QMouseEvent
QLineEdit::changeEvent
virtual void changeEvent(QEvent *ev)
QString::isNull
bool isNull() const
QgsFilterLineEdit::nullValue
QString nullValue() const
Definition:
qgsfilterlineedit.h:38
QgsFilterLineEdit::value
QString value() const
Returns the text of this edit with NULL support.
Definition:
qgsfilterlineedit.h:52
QgsFilterLineEdit
Lineedit with builtin clear button.
Definition:
qgsfilterlineedit.h:28
QString
QLineEdit::paintEvent
virtual void paintEvent(QPaintEvent *)
QgsFilterLineEdit::isNull
bool isNull() const
Determine if the current text represents Null.
Definition:
qgsfilterlineedit.h:59
QToolButton
QLineEdit::focusInEvent
virtual void focusInEvent(QFocusEvent *e)
QLineEdit
QPaintEvent
QWidget::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
QgsFilterLineEdit::setNullValue
void setNullValue(const QString &nullValue)
Definition:
qgsfilterlineedit.h:36
QFocusEvent
isNull
bool isNull(const QVariant &v)
Definition:
qgsexpression.cpp:217
QLineEdit::mousePressEvent
virtual void mousePressEvent(QMouseEvent *e)
QgsFilterLineEdit::setValue
void setValue(const QString &value)
Sets the current text with NULL support.
Definition:
qgsfilterlineedit.h:45
Generated on Sat Oct 24 2015 04:11:25 for QGIS API Documentation by
1.8.9.1