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(),
172 QString displayType(
bool showConstraints = false ) const
SIP_HOLDGIL;
229 QMap<
int, QVariant > metadata() const
SIP_HOLDGIL;
237 QVariant metadata(
Qgis::FieldMetadataProperty property ) const
SIP_SKIP;
245 QVariant metadata(
int property ) const
SIP_HOLDGIL;
255 void setMetadata( const QMap<
int, QVariant > metadata )
SIP_HOLDGIL;
263 void setMetadata(
Qgis::FieldMetadataProperty property, const QVariant &value )
SIP_SKIP;
271 void setMetadata(
int property, const QVariant &value )
SIP_HOLDGIL;
308 void setSubType( QMetaType::Type subType )
SIP_HOLDGIL;
339 void setComment( const QString &comment )
SIP_HOLDGIL;
395 void setConfigurationFlags(
Qgis::FieldConfigurationFlags flags )
SIP_HOLDGIL;
398 QString displayString( const QVariant &v ) const;
404 static QString readableConfigurationFlag(
Qgis::FieldConfigurationFlag flag )
SIP_HOLDGIL;
416 bool convertCompatible( QVariant &v, QString *errorMessage =
nullptr )
const;
426 bool convertCompatible( QVariant &v )
const;
428 PyObject *sipParseErr = NULL;
435 if ( sipParseArgs( &sipParseErr, sipArgs,
"BJ1", &sipSelf, sipType_QgsField, &sipCpp, sipType_QVariant, &a0, &a0State ) )
438 QString errorMessage;
440 Py_BEGIN_ALLOW_THREADS
449 sipReleaseType( a0, sipType_QVariant, a0State );
450 sipRaiseUnknownException();
458 PyErr_SetString( PyExc_ValueError,
459 QString(
"Value could not be converted to field type %1: %2" ).arg( QMetaType::typeName( sipCpp->
type() ), errorMessage ).toUtf8().constData() );
464 PyObject *res = sipConvertFromType( a0, sipType_QVariant, NULL );
465 sipReleaseType( a0, sipType_QVariant, a0State );
472 sipNoMethod( sipParseErr, sipName_QgsField, sipName_convertCompatible, doc_QgsField_convertCompatible );
482 operator QVariant()
const;
533 void setSplitPolicy(
Qgis::FieldDomainSplitPolicy policy )
SIP_HOLDGIL;
553 void setDuplicatePolicy(
Qgis::FieldDuplicatePolicy policy )
SIP_HOLDGIL;
556 SIP_PYOBJECT __repr__();
558 QString
str = QStringLiteral(
"<QgsField: %1 (%2)>" ).arg( sipCpp->
name() ).arg( sipCpp->
typeName() );
559 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
564 static constexpr int MAX_WKT_LENGTH = 999;
569 QSharedDataPointer<QgsFieldPrivate> d;