1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfieldconstraints.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsFieldConstraints
{
%Docstring(signature="appended")
Stores information about constraints which may be present on a field.
%End
%TypeHeaderCode
#include "qgsfieldconstraints.h"
%End
public:
static const QMetaObject staticMetaObject;
public:
enum Constraint /BaseType=IntEnum/
{
ConstraintNotNull,
ConstraintUnique,
ConstraintExpression,
};
typedef QFlags<QgsFieldConstraints::Constraint> Constraints;
enum ConstraintOrigin /BaseType=IntEnum/
{
ConstraintOriginNotSet,
ConstraintOriginProvider,
ConstraintOriginLayer,
};
enum ConstraintStrength /BaseType=IntEnum/
{
ConstraintStrengthNotSet,
ConstraintStrengthHard,
ConstraintStrengthSoft,
};
QgsFieldConstraints();
%Docstring
Constructor for QgsFieldConstraints.
%End
Constraints constraints() const;
%Docstring
Returns any constraints which are present for the field.
.. seealso:: :py:func:`setConstraint`
.. seealso:: :py:func:`constraintOrigin`
%End
ConstraintOrigin constraintOrigin( Constraint constraint ) const;
%Docstring
Returns the origin of a field constraint, or ConstraintOriginNotSet if
the constraint is not present on this field.
.. seealso:: :py:func:`constraints`
%End
ConstraintStrength constraintStrength( Constraint constraint ) const;
%Docstring
Returns the strength of a field constraint, or ConstraintStrengthNotSet
if the constraint is not present on this field. If the strength is not
set returns ConstraintStrengthNotSet for anything but
ConstraintExpression which returns ConstraintStrengthHard.
.. seealso:: :py:func:`constraints`
.. seealso:: :py:func:`setConstraintStrength`
%End
void setConstraintStrength( Constraint constraint, ConstraintStrength strength );
%Docstring
Sets the strength of a constraint. Constraints default to
ConstraintStrengthHard unless explicitly changed.
.. seealso:: :py:func:`constraintStrength`
%End
void setConstraint( Constraint constraint, ConstraintOrigin origin = ConstraintOriginLayer );
%Docstring
Sets a constraint on the field.
.. seealso:: :py:func:`constraints`
.. seealso:: :py:func:`removeConstraint`
%End
void removeConstraint( Constraint constraint );
%Docstring
Removes a constraint from the field.
.. seealso:: :py:func:`setConstraint`
.. seealso:: :py:func:`constraints`
%End
QString constraintExpression() const;
%Docstring
Returns the constraint expression for the field, if set.
.. seealso:: :py:func:`constraints`
.. seealso:: :py:func:`constraintDescription`
.. seealso:: :py:func:`setConstraintExpression`
%End
QString constraintDescription() const;
%Docstring
Returns the descriptive name for the constraint expression.
.. seealso:: :py:func:`constraints`
.. seealso:: :py:func:`constraintExpression`
.. seealso:: :py:func:`setConstraintExpression`
%End
void setConstraintExpression( const QString &expression, const QString &description = QString() );
%Docstring
Set the constraint expression for the field. An optional descriptive
name for the constraint can also be set. Setting an empty expression
will clear any existing expression constraint.
.. seealso:: :py:func:`constraintExpression`
.. seealso:: :py:func:`constraintDescription`
.. seealso:: :py:func:`constraints`
%End
QString domainName() const;
%Docstring
Returns the associated field domain name, for providers which support
field domains.
.. seealso:: :py:func:`setDomainName`
.. versionadded:: 3.26
%End
void setDomainName( const QString &domain );
%Docstring
Sets the associated field ``domain`` name, for providers which support
field domains.
.. seealso:: :py:func:`domainName`
.. versionadded:: 3.26
%End
bool operator==( const QgsFieldConstraints &other ) const;
};
QFlags<QgsFieldConstraints::Constraint> operator|(QgsFieldConstraints::Constraint f1, QFlags<QgsFieldConstraints::Constraint> f2);
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfieldconstraints.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|