2017-04-30 21:58:30 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsfield.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2019-11-05 10:17:34 +01:00
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
class QgsField
|
|
|
|
{
|
2021-03-22 21:13:52 +01:00
|
|
|
%Docstring(signature="appended")
|
2017-12-15 10:36:55 -04:00
|
|
|
Encapsulate a field in an attribute table or data source.
|
2021-02-18 13:36:09 +10:00
|
|
|
|
2021-01-30 09:16:35 +10:00
|
|
|
:py:class:`QgsField` stores metadata about an attribute field, including name, type
|
2017-12-15 10:36:55 -04:00
|
|
|
length, and if applicable, precision.
|
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
.. note::
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2021-01-30 09:16:35 +10:00
|
|
|
:py:class:`QgsField` objects are implicitly shared.
|
2007-01-09 02:39:15 +00:00
|
|
|
%End
|
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsfield.h"
|
|
|
|
%End
|
2018-05-15 17:37:18 -04:00
|
|
|
public:
|
|
|
|
static const QMetaObject staticMetaObject;
|
|
|
|
|
2015-10-11 22:42:28 +02:00
|
|
|
public:
|
2016-10-19 13:42:06 +10:00
|
|
|
|
2020-09-10 22:50:29 +02:00
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
QgsField( const QString &name = QString(),
|
2012-09-24 02:28:15 +02:00
|
|
|
QVariant::Type type = QVariant::Invalid,
|
2017-04-30 21:58:30 +02:00
|
|
|
const QString &typeName = QString(),
|
2012-09-24 02:28:15 +02:00
|
|
|
int len = 0,
|
|
|
|
int prec = 0,
|
2017-04-30 21:58:30 +02:00
|
|
|
const QString &comment = QString(),
|
2016-09-06 15:03:16 +02:00
|
|
|
QVariant::Type subType = QVariant::Invalid );
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor. Constructs a new QgsField object.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param name: Field name
|
|
|
|
:param type: Field variant type, currently supported: String / Int / Double
|
|
|
|
:param typeName: Field type (e.g., char, varchar, text, int, serial, double).
|
2018-05-24 21:21:14 +10:00
|
|
|
Field types are usually unique to the source and are stored exactly
|
2018-05-27 16:33:02 +10:00
|
|
|
as returned from the data store.
|
2017-12-15 10:36:55 -04:00
|
|
|
:param len: Field length
|
|
|
|
:param prec: Field precision. Usually decimal places but may also be
|
2018-05-24 21:21:14 +10:00
|
|
|
used in conjunction with other fields types (e.g., variable character fields)
|
2017-12-15 10:36:55 -04:00
|
|
|
:param comment: Comment for the field
|
|
|
|
:param subType: If the field is a collection, its element's type. When
|
2018-05-24 21:21:14 +10:00
|
|
|
all the elements don't need to have the same type, leave
|
|
|
|
this to QVariant.Invalid.
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsField( const QgsField &other );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Copy constructor
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2015-05-01 20:28:39 +10:00
|
|
|
|
2015-05-03 17:03:37 +10:00
|
|
|
virtual ~QgsField();
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
bool operator==( const QgsField &other ) const;
|
|
|
|
bool operator!=( const QgsField &other ) const;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2015-10-27 14:03:00 +11:00
|
|
|
QString name() const;
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the name of the field.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setName`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`displayName`
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2016-08-30 12:12:47 +10:00
|
|
|
QString displayName() const;
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the name to use when displaying this field. This will be the
|
|
|
|
field alias if set, otherwise the field name.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`name`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`alias`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
.. versionadded:: 3.0
|
2019-10-31 16:58:50 +01:00
|
|
|
%End
|
|
|
|
|
|
|
|
QString displayNameWithAlias() const;
|
|
|
|
%Docstring
|
2019-11-03 10:04:07 +01:00
|
|
|
Returns the name to use when displaying this field and adds the alias in parenthesis if it is defined.
|
2019-10-31 16:58:50 +01:00
|
|
|
|
2019-11-03 10:04:07 +01:00
|
|
|
This will be used when working close to the data structure (i.e. building expressions and queries),
|
2019-10-31 16:58:50 +01:00
|
|
|
when the real field name must be shown but the alias is also useful to understand what the field
|
|
|
|
represents.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`name`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`alias`
|
|
|
|
|
|
|
|
.. versionadded:: 3.12
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
2016-08-30 12:12:47 +10:00
|
|
|
|
2020-03-19 01:40:54 +02:00
|
|
|
|
|
|
|
QString displayType( bool showConstraints = false ) const;
|
|
|
|
%Docstring
|
|
|
|
Returns the type to use when displaying this field, including the length and precision of the datatype if applicable.
|
|
|
|
|
|
|
|
This will be used when the full datatype with details has to displayed to the user.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`type`
|
|
|
|
|
|
|
|
.. versionadded:: 3.14
|
|
|
|
%End
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
QVariant::Type type() const;
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
|
|
|
Gets variant type of the field as it will be retrieved from data source
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2016-09-06 15:03:16 +02:00
|
|
|
QVariant::Type subType() const;
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
If the field is a collection, gets its element's type.
|
|
|
|
When all the elements don't need to have the same type, this returns
|
|
|
|
QVariant.Invalid.
|
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
2016-09-06 15:03:16 +02:00
|
|
|
|
2015-10-27 14:03:00 +11:00
|
|
|
QString typeName() const;
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Gets the field type. Field types vary depending on the data source. Examples
|
|
|
|
are char, int, double, blob, geometry, etc. The type is stored exactly as
|
|
|
|
the data store reports it, with no attempt to standardize the value.
|
|
|
|
|
|
|
|
:return: QString containing the field type
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
int length() const;
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Gets the length of the field.
|
|
|
|
|
|
|
|
:return: int containing the length of the field
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
int precision() const;
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Gets the precision of the field. Not all field types have a related precision.
|
|
|
|
|
|
|
|
:return: int containing the precision or zero if not applicable to the field type.
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2015-10-27 14:03:00 +11:00
|
|
|
QString comment() const;
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the field comment
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2016-08-16 16:22:29 +02:00
|
|
|
bool isNumeric() const;
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns if this field is numeric. Any integer or floating point type
|
2019-02-26 19:54:09 +10:00
|
|
|
will return ``True`` for this.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
.. versionadded:: 2.18
|
2019-01-28 13:53:16 -05:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool isDateOrTime() const;
|
|
|
|
%Docstring
|
|
|
|
Returns if this field is a date and/or time type.
|
|
|
|
|
|
|
|
.. versionadded:: 3.6
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setName( const QString &name );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the field name.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param name: Name of the field
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
void setType( QVariant::Type type );
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set variant type.
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2016-09-06 15:03:16 +02:00
|
|
|
void setSubType( QVariant::Type subType );
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
If the field is a collection, set its element's type.
|
|
|
|
When all the elements don't need to have the same type, set this to
|
|
|
|
QVariant.Invalid.
|
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
2016-09-06 15:03:16 +02:00
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
void setTypeName( const QString &typeName );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the field type.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param typeName: Field type
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
void setLength( int len );
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the field length.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param len: Length of the field
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2015-05-01 20:28:39 +10:00
|
|
|
void setPrecision( int precision );
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the field precision.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param precision: Precision of the field
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setComment( const QString &comment );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the field comment
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2017-09-26 14:25:44 +02:00
|
|
|
QgsDefaultValue defaultValueDefinition() const;
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the expression used when calculating the default value for the field.
|
|
|
|
|
|
|
|
:return: expression evaluated when calculating default values for field, or an
|
2018-05-24 21:21:14 +10:00
|
|
|
empty string if no default is set
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setDefaultValueDefinition`
|
2018-05-28 11:31:08 -04:00
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
|
|
|
|
2017-09-26 14:25:44 +02:00
|
|
|
void setDefaultValueDefinition( const QgsDefaultValue &defaultValueDefinition );
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets an expression to use when calculating the default value for the field.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param defaultValueDefinition: expression to evaluate when calculating default values for field. Pass
|
2018-05-24 21:21:14 +10:00
|
|
|
a default constructed :py:class:`QgsDefaultValue`() to reset.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`defaultValueDefinition`
|
2018-05-28 11:31:08 -04:00
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
const QgsFieldConstraints &constraints() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns constraints which are present for the field.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setConstraints`
|
2018-05-28 11:31:08 -04:00
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setConstraints( const QgsFieldConstraints &constraints );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets constraints which are present for the field.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`constraints`
|
2018-05-28 11:31:08 -04:00
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
2016-08-30 12:12:47 +10:00
|
|
|
|
|
|
|
QString alias() const;
|
2017-04-30 21:58:30 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the alias for the field (the friendly displayed name of the field ),
|
|
|
|
or an empty string if there is no alias.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setAlias`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
|
|
|
void setAlias( const QString &alias );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the alias for the field (the friendly displayed name of the field ).
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param alias: field alias, or empty string to remove an existing alias
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`alias`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
2020-09-10 22:50:29 +02:00
|
|
|
|
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
QString displayString( const QVariant &v ) const;
|
|
|
|
%Docstring
|
|
|
|
Formats string for display
|
|
|
|
%End
|
2016-08-30 12:12:47 +10:00
|
|
|
|
2020-09-14 11:33:21 +02:00
|
|
|
|
2020-07-22 17:29:26 +10:00
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
bool convertCompatible( QVariant &v ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Converts the provided variant to a compatible format
|
2017-04-30 21:58:30 +02:00
|
|
|
|
2018-05-27 16:42:41 +10:00
|
|
|
:param v: The value to convert
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2021-06-25 08:32:25 +10:00
|
|
|
:raises ValueError: if the value could not be converted to a compatible format
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
2014-10-06 10:17:05 +02:00
|
|
|
%MethodCode
|
|
|
|
PyObject *sipParseErr = NULL;
|
|
|
|
|
|
|
|
{
|
2017-04-30 21:58:30 +02:00
|
|
|
QVariant *a0;
|
2014-10-06 10:17:05 +02:00
|
|
|
int a0State = 0;
|
|
|
|
const QgsField *sipCpp;
|
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
if ( sipParseArgs( &sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_QgsField, &sipCpp, sipType_QVariant, &a0, &a0State ) )
|
2014-10-06 10:17:05 +02:00
|
|
|
{
|
|
|
|
bool sipRes;
|
2020-07-22 17:29:26 +10:00
|
|
|
QString errorMessage;
|
2014-10-06 10:17:05 +02:00
|
|
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
try
|
|
|
|
{
|
2020-07-22 17:29:26 +10:00
|
|
|
sipRes = sipCpp->convertCompatible( *a0, &errorMessage );
|
2014-10-06 10:17:05 +02:00
|
|
|
}
|
2017-04-30 21:58:30 +02:00
|
|
|
catch ( ... )
|
2014-10-06 10:17:05 +02:00
|
|
|
{
|
|
|
|
Py_BLOCK_THREADS
|
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
sipReleaseType( a0, sipType_QVariant, a0State );
|
|
|
|
sipRaiseUnknownException();
|
|
|
|
return NULL;
|
2014-10-06 10:17:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
|
|
if ( !sipRes )
|
|
|
|
{
|
2017-04-30 21:58:30 +02:00
|
|
|
PyErr_SetString( PyExc_ValueError,
|
2020-07-22 17:29:26 +10:00
|
|
|
QString( "Value could not be converted to field type %1: %2" ).arg( QMetaType::typeName( sipCpp->type() ), errorMessage ).toUtf8().constData() );
|
|
|
|
sipIsErr = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
PyObject *res = sipConvertFromType( a0, sipType_QVariant, NULL );
|
|
|
|
sipReleaseType( a0, sipType_QVariant, a0State );
|
|
|
|
return res;
|
2014-10-06 10:17:05 +02:00
|
|
|
}
|
2020-07-22 17:29:26 +10:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Raise an exception if the arguments couldn't be parsed.
|
|
|
|
sipNoMethod( sipParseErr, sipName_QgsField, sipName_convertCompatible, doc_QgsField_convertCompatible );
|
2014-10-06 10:17:05 +02:00
|
|
|
|
2020-07-22 17:29:26 +10:00
|
|
|
return nullptr;
|
2014-10-06 10:17:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
%End
|
2016-05-20 09:48:18 +10:00
|
|
|
|
|
|
|
operator QVariant() const;
|
2017-04-30 21:58:30 +02:00
|
|
|
|
|
|
|
void setEditorWidgetSetup( const QgsEditorWidgetSetup &v );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the editor widget setup for the field.
|
2017-04-30 21:58:30 +02:00
|
|
|
|
2018-05-27 16:42:41 +10:00
|
|
|
:param v: The value to set
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsEditorWidgetSetup editorWidgetSetup() const;
|
|
|
|
%Docstring
|
2018-05-26 18:44:30 +10:00
|
|
|
Gets the editor widget setup for the field.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
|
|
Defaults may be set by the provider and can be overridden
|
|
|
|
by manual field configuration.
|
2017-04-30 21:58:30 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:return: the value
|
2020-07-29 15:12:16 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setReadOnly( bool readOnly );
|
|
|
|
%Docstring
|
|
|
|
Make field read-only if ``readOnly`` is set to true. This is the case for
|
|
|
|
providers which support generated fields for instance.
|
|
|
|
|
|
|
|
.. versionadded:: 3.18
|
|
|
|
%End
|
|
|
|
|
|
|
|
bool isReadOnly() const;
|
|
|
|
%Docstring
|
|
|
|
Returns ``True`` if this field is a read-only field. This is the case for
|
|
|
|
providers which support generated fields for instance.
|
|
|
|
|
|
|
|
.. versionadded:: 3.18
|
2017-04-30 21:58:30 +02:00
|
|
|
%End
|
2016-05-20 09:48:18 +10:00
|
|
|
|
2018-07-28 08:06:08 +02:00
|
|
|
SIP_PYOBJECT __repr__();
|
|
|
|
%MethodCode
|
|
|
|
QString str = QStringLiteral( "<QgsField: %1 (%2)>" ).arg( sipCpp->name() ).arg( sipCpp->typeName() );
|
2018-10-06 15:39:40 +02:00
|
|
|
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
|
2018-07-28 08:06:08 +02:00
|
|
|
%End
|
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
}; // class QgsField
|
2016-10-19 13:42:06 +10:00
|
|
|
|
2017-04-30 21:58:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsfield.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|