Skip to content

Commit 84abf89

Browse files
arnaud-morvan3nids
authored andcommittedMay 1, 2017
Sipify QgsFieldConstraints
1 parent 634c7aa commit 84abf89

File tree

2 files changed

+98
-83
lines changed

2 files changed

+98
-83
lines changed
 

‎python/auto_sip.blacklist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ core/qgsexpressioncontextgenerator.sip
1313
core/qgsfeaturefilterprovider.sip
1414
core/qgsfeatureiterator.sip
1515
core/qgsfeaturerequest.sip
16-
core/qgsfieldconstraints.sip
1716
core/qgsfieldformatterregistry.sip
1817
core/qgsfieldformatter.sip
1918
core/qgsgeometrysimplifier.sip

‎python/core/qgsfieldconstraints.sip

Lines changed: 98 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,127 +1,143 @@
1-
/**
2-
* \class QgsFieldConstraints
3-
* \ingroup core
4-
* Stores information about constraints which may be present on a field.
5-
* \note added in QGIS 3.0
6-
*/
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/qgsfieldconstraints.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
711

812

913
class QgsFieldConstraints
1014
{
15+
%Docstring
16+
Stores information about constraints which may be present on a field.
17+
.. versionadded:: 3.0
18+
%End
1119

1220
%TypeHeaderCode
13-
#include <qgsfieldconstraints.h>
21+
#include "qgsfieldconstraints.h"
1422
%End
15-
1623
public:
1724

18-
/**
19-
* Constraints which may be present on a field.
20-
*/
2125
enum Constraint
2226
{
23-
ConstraintNotNull, //!< Field may not be null
24-
ConstraintUnique, //!< Field must have a unique value
25-
ConstraintExpression, //!< Field has an expression constraint set. See constraintExpression().
27+
ConstraintNotNull,
28+
ConstraintUnique,
29+
ConstraintExpression,
2630
};
2731
typedef QFlags<QgsFieldConstraints::Constraint> Constraints;
2832

29-
/**
30-
* Origin of constraints.
31-
*/
33+
3234
enum ConstraintOrigin
3335
{
34-
ConstraintOriginNotSet, //!< Constraint is not set
35-
ConstraintOriginProvider, //!< Constraint was set at data provider
36-
ConstraintOriginLayer, //!< Constraint was set by layer
36+
ConstraintOriginNotSet,
37+
ConstraintOriginProvider,
38+
ConstraintOriginLayer,
3739
};
3840

39-
/**
40-
* Strength of constraints.
41-
*/
4241
enum ConstraintStrength
4342
{
44-
ConstraintStrengthNotSet, //!< Constraint is not set
45-
ConstraintStrengthHard, //!< Constraint must be honored before feature can be accepted
46-
ConstraintStrengthSoft, //!< User is warned if constraint is violated but feature can still be accepted
43+
ConstraintStrengthNotSet,
44+
ConstraintStrengthHard,
45+
ConstraintStrengthSoft,
4746
};
4847

49-
/**
50-
* Constructor for QgsFieldConstraints.
51-
*/
5248
QgsFieldConstraints();
49+
%Docstring
50+
Constructor for QgsFieldConstraints.
51+
%End
5352

54-
/**
55-
* Returns any constraints which are present for the field.
56-
* @see setConstraints()
57-
* @see constraintOrigin()
58-
*/
5953
Constraints constraints() const;
54+
%Docstring
55+
Returns any constraints which are present for the field.
56+
.. seealso:: setConstraints()
57+
.. seealso:: constraintOrigin()
58+
:rtype: Constraints
59+
%End
6060

61-
/**
62-
* Returns the origin of a field constraint, or ConstraintOriginNotSet if the constraint
63-
* is not present on this field.
64-
* @see constraints()
65-
*/
6661
ConstraintOrigin constraintOrigin( Constraint constraint ) const;
62+
%Docstring
63+
Returns the origin of a field constraint, or ConstraintOriginNotSet if the constraint
64+
is not present on this field.
65+
.. seealso:: constraints()
66+
:rtype: ConstraintOrigin
67+
%End
6768

68-
/**
69-
* Returns the strength of a field constraint, or ConstraintStrengthNotSet if the constraint
70-
* is not present on this field.
71-
* @see constraints()
72-
* @see setConstraintStrength()
73-
*/
7469
ConstraintStrength constraintStrength( Constraint constraint ) const;
70+
%Docstring
71+
Returns the strength of a field constraint, or ConstraintStrengthNotSet if the constraint
72+
is not present on this field.
73+
.. seealso:: constraints()
74+
.. seealso:: setConstraintStrength()
75+
:rtype: ConstraintStrength
76+
%End
7577

76-
/**
77-
* Sets the strength of a constraint. Note that the strength of constraints which originate
78-
* from a provider cannot be changed. Constraints default to ConstraintStrengthHard unless
79-
* explicitly changed.
80-
* @see constraintStrength()
81-
*/
8278
void setConstraintStrength( Constraint constraint, ConstraintStrength strength );
79+
%Docstring
80+
Sets the strength of a constraint. Note that the strength of constraints which originate
81+
from a provider cannot be changed. Constraints default to ConstraintStrengthHard unless
82+
explicitly changed.
83+
.. seealso:: constraintStrength()
84+
%End
8385

84-
/**
85-
* Sets a constraint on the field.
86-
* @see constraints()
87-
* @see removeConstraint()
88-
*/
8986
void setConstraint( Constraint constraint, ConstraintOrigin origin = ConstraintOriginLayer );
87+
%Docstring
88+
Sets a constraint on the field.
89+
.. seealso:: constraints()
90+
.. seealso:: removeConstraint()
91+
%End
9092

91-
/**
92-
* Removes a constraint from the field.
93-
* @see setConstraint()
94-
* @see constraints()
95-
*/
9693
void removeConstraint( Constraint constraint );
94+
%Docstring
95+
Removes a constraint from the field.
96+
.. seealso:: setConstraint()
97+
.. seealso:: constraints()
98+
%End
9799

98-
/**
99-
* Returns the constraint expression for the field, if set.
100-
* @see constraints()
101-
* @see constraintDescription()
102-
* @see setConstraintExpression()
103-
*/
104100
QString constraintExpression() const;
101+
%Docstring
102+
Returns the constraint expression for the field, if set.
103+
.. seealso:: constraints()
104+
.. seealso:: constraintDescription()
105+
.. seealso:: setConstraintExpression()
106+
:rtype: str
107+
%End
105108

106-
/**
107-
* Returns the descriptive name for the constraint expression.
108-
* @see constraints()
109-
* @see constraintExpression()
110-
* @see setConstraintExpression()
111-
*/
112109
QString constraintDescription() const;
110+
%Docstring
111+
Returns the descriptive name for the constraint expression.
112+
.. seealso:: constraints()
113+
.. seealso:: constraintExpression()
114+
.. seealso:: setConstraintExpression()
115+
:rtype: str
116+
%End
113117

114-
/**
115-
* Set the constraint expression for the field. An optional descriptive name for the constraint
116-
* can also be set. Setting an empty expression will clear any existing expression constraint.
117-
* @see constraintExpression()
118-
* @see constraintDescription()
119-
* @see constraints()
120-
*/
121-
void setConstraintExpression( const QString& expression, const QString& description = QString() );
118+
void setConstraintExpression( const QString &expression, const QString &description = QString() );
119+
%Docstring
120+
Set the constraint expression for the field. An optional descriptive name for the constraint
121+
can also be set. Setting an empty expression will clear any existing expression constraint.
122+
.. seealso:: constraintExpression()
123+
.. seealso:: constraintDescription()
124+
.. seealso:: constraints()
125+
%End
122126

123-
bool operator==( const QgsFieldConstraints& other ) const;
127+
bool operator==( const QgsFieldConstraints &other ) const;
128+
%Docstring
129+
:rtype: bool
130+
%End
124131

125132
};
126133

127134
QFlags<QgsFieldConstraints::Constraint> operator|(QgsFieldConstraints::Constraint f1, QFlags<QgsFieldConstraints::Constraint> f2);
135+
136+
137+
/************************************************************************
138+
* This file has been generated automatically from *
139+
* *
140+
* src/core/qgsfieldconstraints.h *
141+
* *
142+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
143+
************************************************************************/

0 commit comments

Comments
 (0)
Please sign in to comment.