56 Q_PROPERTY(
bool isNumeric READ isNumeric )
57 Q_PROPERTY(
bool isDateOrTime READ isDateOrTime )
58 Q_PROPERTY(
int length READ length WRITE setLength )
60 Q_PROPERTY( QMetaType::Type type READ type WRITE setType )
61 Q_PROPERTY( QString comment READ comment WRITE setComment )
62 Q_PROPERTY( QString name READ name WRITE setName )
63 Q_PROPERTY( QString alias READ alias WRITE setAlias )
64 Q_PROPERTY(
QgsDefaultValue defaultValueDefinition READ defaultValueDefinition WRITE setDefaultValueDefinition )
66 Q_PROPERTY(
Qgis::FieldConfigurationFlags configurationFlags READ configurationFlags WRITE setConfigurationFlags )
67 Q_PROPERTY(
bool isReadOnly READ isReadOnly WRITE setReadOnly )
86 QgsField( const QString &name = QString(),
87 QMetaType::Type type = QMetaType::Type::UnknownType,
91 const QString &comment = QString(),
92 QMetaType::Type subType = QMetaType::Type::UnknownType )
SIP_HOLDGIL;
111 Q_DECL_DEPRECATED
QgsField( const QString &name,
113 const QString &
typeName = QString(),
116 const QString &comment = QString(),
165 QString displayType(
bool showConstraints = false ) const
SIP_HOLDGIL;
222 QMap<
int, QVariant > metadata() const
SIP_HOLDGIL;
230 QVariant metadata(
Qgis::FieldMetadataProperty property ) const
SIP_SKIP;
238 QVariant metadata(
int property ) const
SIP_HOLDGIL;
248 void setMetadata( const QMap<
int, QVariant > metadata )
SIP_HOLDGIL;
256 void setMetadata(
Qgis::FieldMetadataProperty property, const QVariant &value )
SIP_SKIP;
264 void setMetadata(
int property, const QVariant &value )
SIP_HOLDGIL;
301 void setSubType( QMetaType::Type subType )
SIP_HOLDGIL;
332 void setComment( const QString &comment )
SIP_HOLDGIL;
388 void setConfigurationFlags(
Qgis::FieldConfigurationFlags flags )
SIP_HOLDGIL;
391 QString displayString( const QVariant &v ) const;
397 static QString readableConfigurationFlag(
Qgis::FieldConfigurationFlag flag )
SIP_HOLDGIL;
409 bool convertCompatible( QVariant &v, QString *errorMessage =
nullptr )
const;
419 bool convertCompatible( QVariant &v )
const;
421 PyObject *sipParseErr = NULL;
428 if ( sipParseArgs( &sipParseErr, sipArgs,
"BJ1", &sipSelf, sipType_QgsField, &sipCpp, sipType_QVariant, &a0, &a0State ) )
431 QString errorMessage;
433 Py_BEGIN_ALLOW_THREADS
442 sipReleaseType( a0, sipType_QVariant, a0State );
443 sipRaiseUnknownException();
451 PyErr_SetString( PyExc_ValueError,
452 QString(
"Value could not be converted to field type %1: %2" ).arg( QMetaType::typeName( sipCpp->
type() ), errorMessage ).toUtf8().constData() );
457 PyObject *res = sipConvertFromType( a0, sipType_QVariant, NULL );
458 sipReleaseType( a0, sipType_QVariant, a0State );
465 sipNoMethod( sipParseErr, sipName_QgsField, sipName_convertCompatible, doc_QgsField_convertCompatible );
475 operator QVariant()
const;
526 void setSplitPolicy(
Qgis::FieldDomainSplitPolicy policy )
SIP_HOLDGIL;
546 void setDuplicatePolicy(
Qgis::FieldDuplicatePolicy policy )
SIP_HOLDGIL;
549 SIP_PYOBJECT __repr__();
551 QString str = QStringLiteral(
"<QgsField: %1 (%2)>" ).arg( sipCpp->
name() ).arg( sipCpp->
typeName() );
552 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
557 static constexpr int MAX_WKT_LENGTH = 999;
562 QSharedDataPointer<QgsFieldPrivate> d;