|
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 | + |
7 | 11 |
|
8 | 12 |
|
9 | 13 | class QgsFieldConstraints
|
10 | 14 | {
|
| 15 | +%Docstring |
| 16 | + Stores information about constraints which may be present on a field. |
| 17 | +.. versionadded:: 3.0 |
| 18 | +%End |
11 | 19 |
|
12 | 20 | %TypeHeaderCode
|
13 |
| -#include <qgsfieldconstraints.h> |
| 21 | +#include "qgsfieldconstraints.h" |
14 | 22 | %End
|
15 |
| - |
16 | 23 | public:
|
17 | 24 |
|
18 |
| - /** |
19 |
| - * Constraints which may be present on a field. |
20 |
| - */ |
21 | 25 | enum Constraint
|
22 | 26 | {
|
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, |
26 | 30 | };
|
27 | 31 | typedef QFlags<QgsFieldConstraints::Constraint> Constraints;
|
28 | 32 |
|
29 |
| - /** |
30 |
| - * Origin of constraints. |
31 |
| - */ |
| 33 | + |
32 | 34 | enum ConstraintOrigin
|
33 | 35 | {
|
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, |
37 | 39 | };
|
38 | 40 |
|
39 |
| - /** |
40 |
| - * Strength of constraints. |
41 |
| - */ |
42 | 41 | enum ConstraintStrength
|
43 | 42 | {
|
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, |
47 | 46 | };
|
48 | 47 |
|
49 |
| - /** |
50 |
| - * Constructor for QgsFieldConstraints. |
51 |
| - */ |
52 | 48 | QgsFieldConstraints();
|
| 49 | +%Docstring |
| 50 | + Constructor for QgsFieldConstraints. |
| 51 | +%End |
53 | 52 |
|
54 |
| - /** |
55 |
| - * Returns any constraints which are present for the field. |
56 |
| - * @see setConstraints() |
57 |
| - * @see constraintOrigin() |
58 |
| - */ |
59 | 53 | 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 |
60 | 60 |
|
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 |
| - */ |
66 | 61 | 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 |
67 | 68 |
|
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 |
| - */ |
74 | 69 | 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 |
75 | 77 |
|
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 |
| - */ |
82 | 78 | 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 |
83 | 85 |
|
84 |
| - /** |
85 |
| - * Sets a constraint on the field. |
86 |
| - * @see constraints() |
87 |
| - * @see removeConstraint() |
88 |
| - */ |
89 | 86 | void setConstraint( Constraint constraint, ConstraintOrigin origin = ConstraintOriginLayer );
|
| 87 | +%Docstring |
| 88 | + Sets a constraint on the field. |
| 89 | +.. seealso:: constraints() |
| 90 | +.. seealso:: removeConstraint() |
| 91 | +%End |
90 | 92 |
|
91 |
| - /** |
92 |
| - * Removes a constraint from the field. |
93 |
| - * @see setConstraint() |
94 |
| - * @see constraints() |
95 |
| - */ |
96 | 93 | void removeConstraint( Constraint constraint );
|
| 94 | +%Docstring |
| 95 | + Removes a constraint from the field. |
| 96 | +.. seealso:: setConstraint() |
| 97 | +.. seealso:: constraints() |
| 98 | +%End |
97 | 99 |
|
98 |
| - /** |
99 |
| - * Returns the constraint expression for the field, if set. |
100 |
| - * @see constraints() |
101 |
| - * @see constraintDescription() |
102 |
| - * @see setConstraintExpression() |
103 |
| - */ |
104 | 100 | 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 |
105 | 108 |
|
106 |
| - /** |
107 |
| - * Returns the descriptive name for the constraint expression. |
108 |
| - * @see constraints() |
109 |
| - * @see constraintExpression() |
110 |
| - * @see setConstraintExpression() |
111 |
| - */ |
112 | 109 | 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 |
113 | 117 |
|
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 |
122 | 126 |
|
123 |
| - bool operator==( const QgsFieldConstraints& other ) const; |
| 127 | + bool operator==( const QgsFieldConstraints &other ) const; |
| 128 | +%Docstring |
| 129 | + :rtype: bool |
| 130 | +%End |
124 | 131 |
|
125 | 132 | };
|
126 | 133 |
|
127 | 134 | 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