QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
z
Variables
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
c
e
f
g
h
k
l
m
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Functions
3
a
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
v
Files
File List
File Members
All
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
w
Typedefs
3
a
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
c
l
s
t
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
w
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
gui
qgsfieldvalidator.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsfieldvalidator.h - description
3
-------------------
4
begin : March 2011
5
copyright : (C) 2011 by SunilRajKiran-kCube
6
email : sunilraj.kiran@kcubeconsulting.com
7
8
adapted version of QValidator for QgsField
9
***************************************************************************/
10
11
/***************************************************************************
12
* *
13
* This program is free software; you can redistribute it and/or modify *
14
* it under the terms of the GNU General Public License as published by *
15
* the Free Software Foundation; either version 2 of the License, or *
16
* (at your option) any later version. *
17
* *
18
***************************************************************************/
19
20
#ifndef QGSFIELDVALIDATOR_H
21
#define QGSFIELDVALIDATOR_H
22
23
#include <QValidator>
24
#include <QVariant>
25
#include <QSettings>
26
#include "
qgsfields.h
"
27
#include "qgis_gui.h"
28
33
class
GUI_EXPORT
QgsFieldValidator
:
public
QValidator
34
{
35
Q_OBJECT
36
37
public
:
38
QgsFieldValidator
( QObject *parent,
const
QgsField
&
field
,
const
QString &defaultValue,
const
QString &dateFormat =
"yyyy-MM-dd"
);
39
~
QgsFieldValidator
()
override
;
40
41
State validate( QString &s
SIP_CONSTRAINED
SIP_INOUT
,
int
&i
SIP_INOUT
)
const override
;
42
void
fixup( QString &s
SIP_CONSTRAINED
)
const override
;
43
44
QString
dateFormat
()
const
{
return
mDateFormat; }
45
46
private
:
47
// Disables copy constructing
48
Q_DISABLE_COPY(
QgsFieldValidator
)
49
50
QValidator *mValidator =
nullptr
;
51
QgsField
mField;
52
QString mNullValue;
53
QString mDefaultValue;
54
QString mDateFormat;
55
};
56
57
// clazy:excludeall=qstring-allocations
58
59
#endif // QGSFIELDVALIDATOR_H
qgsfields.h
field
const QgsField & field
Definition:
qgsfield.h:456
SIP_INOUT
#define SIP_INOUT
Definition:
qgis_sip.h:71
QgsFieldValidator::dateFormat
QString dateFormat() const
Definition:
qgsfieldvalidator.h:44
QgsFieldValidator
Definition:
qgsfieldvalidator.h:34
QgsField
Encapsulate a field in an attribute table or data source.
Definition:
qgsfield.h:50
SIP_CONSTRAINED
#define SIP_CONSTRAINED
Definition:
qgis_sip.h:111
Generated on Sat Oct 24 2020 17:43:09 for QGIS API Documentation by
1.8.20