Add \deprecated tag

This commit is contained in:
Julien Cabieces 2024-05-07 17:04:13 +02:00 committed by Nyall Dawson
parent 1170aa15ee
commit 848fb16785
39 changed files with 311 additions and 80 deletions

View File

@ -563,7 +563,7 @@ quotations where required.
.. seealso:: :py:func:`quotedColumnRef`
%End
static QString quotedValue( const QVariant &value, QVariant::Type type );
static QString quotedValue( const QVariant &value, QVariant::Type type ) /Deprecated/;
%Docstring
Returns a string representation of a literal value, including appropriate
quotations where required.
@ -574,6 +574,9 @@ quotations where required.
.. seealso:: :py:func:`quotedString`
.. seealso:: :py:func:`quotedColumnRef`
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
@ -670,7 +673,7 @@ value. The value may be null.
:return: the expression to evaluate field equality
%End
static QString createFieldEqualityExpression( const QString &fieldName, const QVariant &value, QVariant::Type fieldType );
static QString createFieldEqualityExpression( const QString &fieldName, const QVariant &value, QVariant::Type fieldType ) /Deprecated/;
%Docstring
Create an expression allowing to evaluate if a field is equal to a
value. The value may be null.
@ -680,6 +683,9 @@ value. The value may be null.
:param fieldType: the type of the field on the left side used to quote the value. If not given, the value type is used instead
:return: the expression to evaluate field equality
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
static bool isFieldEqualityExpression( const QString &expression, QString &field /Out/, QVariant &value /Out/ );

View File

@ -49,7 +49,7 @@ The type is expected to be one of
- QVariant.Time
%End
static QString defaultFormat( QVariant::Type type );
static QString defaultFormat( QVariant::Type type ) /Deprecated/;
%Docstring
Gets the default format in function of the type.
The type is expected to be one of
@ -57,6 +57,9 @@ The type is expected to be one of
- QVariant.DateTime
- QVariant.Date
- QVariant.Time
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
static QString defaultDisplayFormat( QMetaType::Type type );
@ -71,7 +74,7 @@ The type is expected to be one of
.. versionadded:: 3.30
%End
static QString defaultDisplayFormat( QVariant::Type type );
static QString defaultDisplayFormat( QVariant::Type type ) /Deprecated/;
%Docstring
Gets the default display format in function of the type.
The type is expected to be one of
@ -81,6 +84,9 @@ The type is expected to be one of
- QVariant.Time
.. versionadded:: 3.30
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
};

View File

@ -58,13 +58,33 @@ Constructor. Constructs a new QgsField object.
this to QVariant.Invalid.
%End
QgsField( const QString &name,
QVariant::Type type,
const QString &typeName = QString(),
int len = 0,
int prec = 0,
const QString &comment = QString(),
QVariant::Type subType = QVariant::Invalid );
QVariant::Type subType = QVariant::Invalid ) /Deprecated/;
%Docstring
Constructor. Constructs a new QgsField object.
: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).
Field types are usually unique to the source and are stored exactly
as returned from the data store.
:param len: Field length
:param prec: Field precision. Usually decimal places but may also be
used in conjunction with other fields types (e.g., variable character fields)
:param comment: Comment for the field
:param subType: If the field is a collection, its element's type. When
all the elements don't need to have the same type, leave
this to QVariant.Invalid.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
QgsField( const QgsField &other ) /HoldGIL/;
%Docstring
@ -242,12 +262,15 @@ Set the field name.
void setType( QMetaType::Type type ) /HoldGIL/;
%Docstring
Set variant type.
Set variant ``type``.
%End
void setType( QVariant::Type type );
void setType( QVariant::Type type ) /Deprecated/;
%Docstring
Set variant type.
Set variant ``type``.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
void setSubType( QMetaType::Type subType ) /HoldGIL/;
@ -257,11 +280,14 @@ When all the elements don't need to have the same type, set this to
QVariant.Invalid.
%End
void setSubType( QVariant::Type subType );
void setSubType( QVariant::Type subType ) /Deprecated/;
%Docstring
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.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
void setTypeName( const QString &typeName ) /HoldGIL/;

View File

@ -356,7 +356,7 @@ Since QGIS 3.30, the optional ``typeString`` argument can be used to specify fie
.. versionadded:: 3.16
%End
static QIcon iconForFieldType( QVariant::Type type, QVariant::Type subType, const QString &typeString = QString() );
static QIcon iconForFieldType( QVariant::Type type, QVariant::Type subType, const QString &typeString = QString() ) /Deprecated/;
%Docstring
Returns an icon corresponding to a field ``type``
@ -364,6 +364,9 @@ Since QGIS 3.24, the optional ``subType`` argument can be used to specify the ty
Since QGIS 3.30, the optional ``typeString`` argument can be used to specify field type strings for handling user field types.
.. versionadded:: 3.16
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
operator QVariant() const;

View File

@ -348,7 +348,7 @@ Parse a simple array (depth=1)
the conversion is not possible.
%End
Q_INVOKABLE static QVariantList parseArray( const QString &json, QVariant::Type type );
static QVariantList parseArray( const QString &json, QVariant::Type type ) /Deprecated/;
%Docstring
Parse a simple array (depth=1)
@ -356,6 +356,9 @@ Parse a simple array (depth=1)
:param type: optional variant type of the elements, if specified (and not Invalid),
the array items will be converted to the type, and discarded if
the conversion is not possible.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End

View File

@ -29,11 +29,14 @@ Returns a user-friendly translated string representing a QVariant ``type``.
The optional ``subType`` can be used to specify the type of variant list or map values.
%End
static QString typeToDisplayString( QVariant::Type type, QVariant::Type subType = QVariant::Type::Invalid );
static QString typeToDisplayString( QVariant::Type type, QVariant::Type subType = QVariant::Type::Invalid ) /Deprecated/;
%Docstring
Returns a user-friendly translated string representing a QVariant ``type``.
The optional ``subType`` can be used to specify the type of variant list or map values.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
static bool isNull( const QVariant &variant);

View File

@ -73,9 +73,12 @@ The Field class represents a Raster Attribute Table field, including its name, u
Creates a new Field with ``name``, ``type`` and ``usage``.
%End
Field( const QString &name, const Qgis::RasterAttributeTableFieldUsage &usage, const QVariant::Type type );
Field( const QString &name, const Qgis::RasterAttributeTableFieldUsage &usage, const QVariant::Type type ) /Deprecated/;
%Docstring
Creates a new Field with ``name``, ``type`` and ``usage``.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
bool isColor( ) const;
@ -260,9 +263,12 @@ Inserts a new ``field`` at ``position``, optionally reporting any error in ``err
Creates a new field from ``name``, ``usage`` and ``type`` and inserts it at ``position``, optionally reporting any error in ``errorMessage``, returns ``True`` on success.
%End
bool insertField( int position, const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QVariant::Type type, QString *errorMessage /Out/ = 0 );
bool insertField( int position, const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QVariant::Type type, QString *errorMessage /Out/ = 0 ) /Deprecated/;
%Docstring
Creates a new field from ``name``, ``usage`` and ``type`` and inserts it at ``position``, optionally reporting any error in ``errorMessage``, returns ``True`` on success.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
bool insertColor( int position, QString *errorMessage /Out/ = 0 );

View File

@ -51,9 +51,12 @@ Constructor for QgsFieldDomain, with the specified ``name``, ``description`` and
QgsFieldDomain( const QString &name,
const QString &description,
QVariant::Type fieldType );
QVariant::Type fieldType ) /Deprecated/;
%Docstring
Constructor for QgsFieldDomain, with the specified ``name``, ``description`` and ``fieldType``.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
virtual ~QgsFieldDomain();
@ -115,11 +118,14 @@ Sets the associated field ``type``.
.. seealso:: :py:func:`fieldType`
%End
void setFieldType( QVariant::Type type );
void setFieldType( QVariant::Type type ) /Deprecated/;
%Docstring
Sets the associated field ``type``.
.. seealso:: :py:func:`fieldType`
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
Qgis::FieldDomainSplitPolicy splitPolicy() const;
@ -232,12 +238,15 @@ appear only once, but it is the responsibility of the user to check this.
QgsCodedFieldDomain( const QString &name,
const QString &description,
QVariant::Type fieldType,
const QList<QgsCodedValue> &values );
const QList<QgsCodedValue> &values ) /Deprecated/;
%Docstring
Constructor for QgsCodedFieldDomain, with the associated ``name``, ``description`` and ``fieldType``.
The ``values`` list details the coded field values as :py:class:`QgsCodedValue` objects. Each code should
appear only once, but it is the responsibility of the user to check this.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
@ -305,11 +314,14 @@ Set an invalid QVariant for ``minimum`` or ``maximum`` respectively if no minimu
const QVariant &minimum,
bool minimumIsInclusive,
const QVariant &maximum,
bool maximumIsInclusive );
bool maximumIsInclusive ) /Deprecated/;
%Docstring
Constructor for QgsRangeFieldDomain, with the specified ``name``, ``description`` and ``fieldType``.
Set an invalid QVariant for ``minimum`` or ``maximum`` respectively if no minimum or maximum value is desired.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
@ -444,11 +456,14 @@ The ``glob`` argument specifies the content validation glob, e.g. "*[a-z][0-1]?"
QgsGlobFieldDomain( const QString &name,
const QString &description,
QVariant::Type fieldType,
const QString &glob );
const QString &glob ) /Deprecated/;
%Docstring
Constructor for QgsGlobFieldDomain, with the specified ``name``, ``description`` and ``fieldType``.
The ``glob`` argument specifies the content validation glob, e.g. "*[a-z][0-1]?".
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End

View File

@ -493,7 +493,7 @@ check if provider supports type of field
NativeType( const QString &typeDesc, const QString &typeName, QVariant::Type type, int minLen = 0, int maxLen = 0, int minPrec = 0, int maxPrec = 0, QVariant::Type subType = QVariant::Type::Invalid );
QString mTypeDesc;
QString mTypeDesc;
QString mTypeName;
QMetaType::Type mType;
int mMinLen;
@ -569,8 +569,17 @@ providers will return ``None``.
%End
static QVariant convertValue( QMetaType::Type type, const QString &value );
%Docstring
Convert ``value`` to ``type``
%End
static QVariant convertValue( QVariant::Type type, const QString &value );
static QVariant convertValue( QVariant::Type type, const QString &value ) /Deprecated/;
%Docstring
Convert ``value`` to ``type``
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
virtual QgsTransaction *transaction() const;
%Docstring

View File

@ -32,9 +32,12 @@ Constructor
Based on the ``type`` of underlying data, some aggregates will be available or not.
%End
void setType( QVariant::Type type );
void setType( QVariant::Type type ) /Deprecated/;
%Docstring
Based on the ``type`` of underlying data, some aggregates will be available or not.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
QMetaType::Type type() const;

View File

@ -62,11 +62,14 @@ documentPath returns the path of the current document in the widget
:param type: determines the type of the returned null variant if the document is not defined yet
%End
QVariant documentPath( QVariant::Type type ) const;
QVariant documentPath( QVariant::Type type ) const /Deprecated/;
%Docstring
documentPath returns the path of the current document in the widget
:param type: determines the type of the returned null variant if the document is not defined yet
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
void setDocumentPath( const QVariant &documentPath );

View File

@ -80,7 +80,7 @@ Inserts a field at the given position.
- errorMessage: error message
%End
bool insertField( const int position, const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QVariant::Type type, QString *errorMessage /Out/ = 0 );
bool insertField( const int position, const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QVariant::Type type, QString *errorMessage /Out/ = 0 ) /Deprecated/;
%Docstring
Inserts a field at the given position.
@ -91,6 +91,9 @@ Inserts a field at the given position.
:return: - true on success
- errorMessage: error message
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
bool removeField( const int position, QString *errorMessage /Out/ = 0 );

View File

@ -33,12 +33,15 @@ Constructor for QgsServerParameterDefinition.
QgsServerParameterDefinition( const QVariant::Type type,
const QVariant defaultValue = QVariant( "" ) );
const QVariant defaultValue = QVariant( "" ) ) /Deprecated/;
%Docstring
Constructor for QgsServerParameterDefinition.
:param type: The type of the parameter
:param defaultValue: The default value of the parameter
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
@ -245,13 +248,16 @@ Constructor for QgsServerParameter.
QgsServerParameter( const QgsServerParameter::Name name,
const QVariant::Type type,
const QVariant defaultValue = QVariant( "" ) );
const QVariant defaultValue = QVariant( "" ) ) /Deprecated/;
%Docstring
Constructor for QgsServerParameter.
:param name: The name of the parameter
:param type: The type of the parameter
:param defaultValue: The default value to use if not defined
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
void raiseError() const;

View File

@ -563,7 +563,7 @@ quotations where required.
.. seealso:: :py:func:`quotedColumnRef`
%End
static QString quotedValue( const QVariant &value, QVariant::Type type );
static QString quotedValue( const QVariant &value, QVariant::Type type ) /Deprecated/;
%Docstring
Returns a string representation of a literal value, including appropriate
quotations where required.
@ -574,6 +574,9 @@ quotations where required.
.. seealso:: :py:func:`quotedString`
.. seealso:: :py:func:`quotedColumnRef`
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
@ -670,7 +673,7 @@ value. The value may be null.
:return: the expression to evaluate field equality
%End
static QString createFieldEqualityExpression( const QString &fieldName, const QVariant &value, QVariant::Type fieldType );
static QString createFieldEqualityExpression( const QString &fieldName, const QVariant &value, QVariant::Type fieldType ) /Deprecated/;
%Docstring
Create an expression allowing to evaluate if a field is equal to a
value. The value may be null.
@ -680,6 +683,9 @@ value. The value may be null.
:param fieldType: the type of the field on the left side used to quote the value. If not given, the value type is used instead
:return: the expression to evaluate field equality
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
static bool isFieldEqualityExpression( const QString &expression, QString &field /Out/, QVariant &value /Out/ );

View File

@ -49,7 +49,7 @@ The type is expected to be one of
- QVariant.Time
%End
static QString defaultFormat( QVariant::Type type );
static QString defaultFormat( QVariant::Type type ) /Deprecated/;
%Docstring
Gets the default format in function of the type.
The type is expected to be one of
@ -57,6 +57,9 @@ The type is expected to be one of
- QVariant.DateTime
- QVariant.Date
- QVariant.Time
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
static QString defaultDisplayFormat( QMetaType::Type type );
@ -71,7 +74,7 @@ The type is expected to be one of
.. versionadded:: 3.30
%End
static QString defaultDisplayFormat( QVariant::Type type );
static QString defaultDisplayFormat( QVariant::Type type ) /Deprecated/;
%Docstring
Gets the default display format in function of the type.
The type is expected to be one of
@ -81,6 +84,9 @@ The type is expected to be one of
- QVariant.Time
.. versionadded:: 3.30
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
};

View File

@ -58,13 +58,33 @@ Constructor. Constructs a new QgsField object.
this to QVariant.Invalid.
%End
QgsField( const QString &name,
QVariant::Type type,
const QString &typeName = QString(),
int len = 0,
int prec = 0,
const QString &comment = QString(),
QVariant::Type subType = QVariant::Invalid );
QVariant::Type subType = QVariant::Invalid ) /Deprecated/;
%Docstring
Constructor. Constructs a new QgsField object.
: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).
Field types are usually unique to the source and are stored exactly
as returned from the data store.
:param len: Field length
:param prec: Field precision. Usually decimal places but may also be
used in conjunction with other fields types (e.g., variable character fields)
:param comment: Comment for the field
:param subType: If the field is a collection, its element's type. When
all the elements don't need to have the same type, leave
this to QVariant.Invalid.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
QgsField( const QgsField &other ) /HoldGIL/;
%Docstring
@ -242,12 +262,15 @@ Set the field name.
void setType( QMetaType::Type type ) /HoldGIL/;
%Docstring
Set variant type.
Set variant ``type``.
%End
void setType( QVariant::Type type );
void setType( QVariant::Type type ) /Deprecated/;
%Docstring
Set variant type.
Set variant ``type``.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
void setSubType( QMetaType::Type subType ) /HoldGIL/;
@ -257,11 +280,14 @@ When all the elements don't need to have the same type, set this to
QVariant.Invalid.
%End
void setSubType( QVariant::Type subType );
void setSubType( QVariant::Type subType ) /Deprecated/;
%Docstring
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.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
void setTypeName( const QString &typeName ) /HoldGIL/;

View File

@ -356,7 +356,7 @@ Since QGIS 3.30, the optional ``typeString`` argument can be used to specify fie
.. versionadded:: 3.16
%End
static QIcon iconForFieldType( QVariant::Type type, QVariant::Type subType, const QString &typeString = QString() );
static QIcon iconForFieldType( QVariant::Type type, QVariant::Type subType, const QString &typeString = QString() ) /Deprecated/;
%Docstring
Returns an icon corresponding to a field ``type``
@ -364,6 +364,9 @@ Since QGIS 3.24, the optional ``subType`` argument can be used to specify the ty
Since QGIS 3.30, the optional ``typeString`` argument can be used to specify field type strings for handling user field types.
.. versionadded:: 3.16
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
operator QVariant() const;

View File

@ -348,7 +348,7 @@ Parse a simple array (depth=1)
the conversion is not possible.
%End
Q_INVOKABLE static QVariantList parseArray( const QString &json, QVariant::Type type );
static QVariantList parseArray( const QString &json, QVariant::Type type ) /Deprecated/;
%Docstring
Parse a simple array (depth=1)
@ -356,6 +356,9 @@ Parse a simple array (depth=1)
:param type: optional variant type of the elements, if specified (and not Invalid),
the array items will be converted to the type, and discarded if
the conversion is not possible.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End

View File

@ -29,11 +29,14 @@ Returns a user-friendly translated string representing a QVariant ``type``.
The optional ``subType`` can be used to specify the type of variant list or map values.
%End
static QString typeToDisplayString( QVariant::Type type, QVariant::Type subType = QVariant::Type::Invalid );
static QString typeToDisplayString( QVariant::Type type, QVariant::Type subType = QVariant::Type::Invalid ) /Deprecated/;
%Docstring
Returns a user-friendly translated string representing a QVariant ``type``.
The optional ``subType`` can be used to specify the type of variant list or map values.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
static bool isNull( const QVariant &variant);

View File

@ -73,9 +73,12 @@ The Field class represents a Raster Attribute Table field, including its name, u
Creates a new Field with ``name``, ``type`` and ``usage``.
%End
Field( const QString &name, const Qgis::RasterAttributeTableFieldUsage &usage, const QVariant::Type type );
Field( const QString &name, const Qgis::RasterAttributeTableFieldUsage &usage, const QVariant::Type type ) /Deprecated/;
%Docstring
Creates a new Field with ``name``, ``type`` and ``usage``.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
bool isColor( ) const;
@ -260,9 +263,12 @@ Inserts a new ``field`` at ``position``, optionally reporting any error in ``err
Creates a new field from ``name``, ``usage`` and ``type`` and inserts it at ``position``, optionally reporting any error in ``errorMessage``, returns ``True`` on success.
%End
bool insertField( int position, const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QVariant::Type type, QString *errorMessage /Out/ = 0 );
bool insertField( int position, const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QVariant::Type type, QString *errorMessage /Out/ = 0 ) /Deprecated/;
%Docstring
Creates a new field from ``name``, ``usage`` and ``type`` and inserts it at ``position``, optionally reporting any error in ``errorMessage``, returns ``True`` on success.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
bool insertColor( int position, QString *errorMessage /Out/ = 0 );

View File

@ -51,9 +51,12 @@ Constructor for QgsFieldDomain, with the specified ``name``, ``description`` and
QgsFieldDomain( const QString &name,
const QString &description,
QVariant::Type fieldType );
QVariant::Type fieldType ) /Deprecated/;
%Docstring
Constructor for QgsFieldDomain, with the specified ``name``, ``description`` and ``fieldType``.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
virtual ~QgsFieldDomain();
@ -115,11 +118,14 @@ Sets the associated field ``type``.
.. seealso:: :py:func:`fieldType`
%End
void setFieldType( QVariant::Type type );
void setFieldType( QVariant::Type type ) /Deprecated/;
%Docstring
Sets the associated field ``type``.
.. seealso:: :py:func:`fieldType`
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
Qgis::FieldDomainSplitPolicy splitPolicy() const;
@ -232,12 +238,15 @@ appear only once, but it is the responsibility of the user to check this.
QgsCodedFieldDomain( const QString &name,
const QString &description,
QVariant::Type fieldType,
const QList<QgsCodedValue> &values );
const QList<QgsCodedValue> &values ) /Deprecated/;
%Docstring
Constructor for QgsCodedFieldDomain, with the associated ``name``, ``description`` and ``fieldType``.
The ``values`` list details the coded field values as :py:class:`QgsCodedValue` objects. Each code should
appear only once, but it is the responsibility of the user to check this.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
@ -305,11 +314,14 @@ Set an invalid QVariant for ``minimum`` or ``maximum`` respectively if no minimu
const QVariant &minimum,
bool minimumIsInclusive,
const QVariant &maximum,
bool maximumIsInclusive );
bool maximumIsInclusive ) /Deprecated/;
%Docstring
Constructor for QgsRangeFieldDomain, with the specified ``name``, ``description`` and ``fieldType``.
Set an invalid QVariant for ``minimum`` or ``maximum`` respectively if no minimum or maximum value is desired.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
@ -444,11 +456,14 @@ The ``glob`` argument specifies the content validation glob, e.g. "*[a-z][0-1]?"
QgsGlobFieldDomain( const QString &name,
const QString &description,
QVariant::Type fieldType,
const QString &glob );
const QString &glob ) /Deprecated/;
%Docstring
Constructor for QgsGlobFieldDomain, with the specified ``name``, ``description`` and ``fieldType``.
The ``glob`` argument specifies the content validation glob, e.g. "*[a-z][0-1]?".
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End

View File

@ -493,7 +493,7 @@ check if provider supports type of field
NativeType( const QString &typeDesc, const QString &typeName, QVariant::Type type, int minLen = 0, int maxLen = 0, int minPrec = 0, int maxPrec = 0, QVariant::Type subType = QVariant::Type::Invalid );
QString mTypeDesc;
QString mTypeDesc;
QString mTypeName;
QMetaType::Type mType;
int mMinLen;
@ -569,8 +569,17 @@ providers will return ``None``.
%End
static QVariant convertValue( QMetaType::Type type, const QString &value );
%Docstring
Convert ``value`` to ``type``
%End
static QVariant convertValue( QVariant::Type type, const QString &value );
static QVariant convertValue( QVariant::Type type, const QString &value ) /Deprecated/;
%Docstring
Convert ``value`` to ``type``
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
virtual QgsTransaction *transaction() const;
%Docstring

View File

@ -32,9 +32,12 @@ Constructor
Based on the ``type`` of underlying data, some aggregates will be available or not.
%End
void setType( QVariant::Type type );
void setType( QVariant::Type type ) /Deprecated/;
%Docstring
Based on the ``type`` of underlying data, some aggregates will be available or not.
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
QMetaType::Type type() const;

View File

@ -62,11 +62,14 @@ documentPath returns the path of the current document in the widget
:param type: determines the type of the returned null variant if the document is not defined yet
%End
QVariant documentPath( QVariant::Type type ) const;
QVariant documentPath( QVariant::Type type ) const /Deprecated/;
%Docstring
documentPath returns the path of the current document in the widget
:param type: determines the type of the returned null variant if the document is not defined yet
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
void setDocumentPath( const QVariant &documentPath );

View File

@ -80,7 +80,7 @@ Inserts a field at the given position.
- errorMessage: error message
%End
bool insertField( const int position, const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QVariant::Type type, QString *errorMessage /Out/ = 0 );
bool insertField( const int position, const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QVariant::Type type, QString *errorMessage /Out/ = 0 ) /Deprecated/;
%Docstring
Inserts a field at the given position.
@ -91,6 +91,9 @@ Inserts a field at the given position.
:return: - true on success
- errorMessage: error message
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
bool removeField( const int position, QString *errorMessage /Out/ = 0 );

View File

@ -33,12 +33,15 @@ Constructor for QgsServerParameterDefinition.
QgsServerParameterDefinition( const QVariant::Type type,
const QVariant defaultValue = QVariant( "" ) );
const QVariant defaultValue = QVariant( "" ) ) /Deprecated/;
%Docstring
Constructor for QgsServerParameterDefinition.
:param type: The type of the parameter
:param defaultValue: The default value of the parameter
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
@ -245,13 +248,16 @@ Constructor for QgsServerParameter.
QgsServerParameter( const QgsServerParameter::Name name,
const QVariant::Type type,
const QVariant defaultValue = QVariant( "" ) );
const QVariant defaultValue = QVariant( "" ) ) /Deprecated/;
%Docstring
Constructor for QgsServerParameter.
:param name: The name of the parameter
:param type: The type of the parameter
:param defaultValue: The default value to use if not defined
.. deprecated:: QGIS 3.38
use the method with a QMetaType.Type argument instead
%End
void raiseError() const;

View File

@ -671,8 +671,9 @@ class CORE_EXPORT QgsExpression
* \param type value type
* \see quotedString()
* \see quotedColumnRef()
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED static QString quotedValue( const QVariant &value, QVariant::Type type );
Q_DECL_DEPRECATED static QString quotedValue( const QVariant &value, QVariant::Type type ) SIP_DEPRECATED;
//////
@ -762,8 +763,9 @@ class CORE_EXPORT QgsExpression
* \param value the value of the field
* \param fieldType the type of the field on the left side used to quote the value. If not given, the value type is used instead
* \returns the expression to evaluate field equality
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED static QString createFieldEqualityExpression( const QString &fieldName, const QVariant &value, QVariant::Type fieldType );
Q_DECL_DEPRECATED static QString createFieldEqualityExpression( const QString &fieldName, const QVariant &value, QVariant::Type fieldType ) SIP_DEPRECATED;
/**
* Returns TRUE if the given \a expression is a simple "field=value" type expression.

View File

@ -64,8 +64,10 @@ class CORE_EXPORT QgsDateTimeFieldFormatter : public QgsFieldFormatter
* - QVariant::DateTime
* - QVariant::Date
* - QVariant::Time
*
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED static QString defaultFormat( QVariant::Type type );
Q_DECL_DEPRECATED static QString defaultFormat( QVariant::Type type ) SIP_DEPRECATED;
/**
* Gets the default display format in function of the type.
@ -88,8 +90,9 @@ class CORE_EXPORT QgsDateTimeFieldFormatter : public QgsFieldFormatter
* - QVariant::Time
*
* \since QGIS 3.30
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED static QString defaultDisplayFormat( QVariant::Type type );
Q_DECL_DEPRECATED static QString defaultDisplayFormat( QVariant::Type type ) SIP_DEPRECATED;
/**
* Adjusts the date time display formats according to locale.

View File

@ -91,13 +91,30 @@ class CORE_EXPORT QgsField
const QString &comment = QString(),
QMetaType::Type subType = QMetaType::Type::UnknownType ) SIP_HOLDGIL;
/**
* Constructor. Constructs a new QgsField object.
* \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).
* Field types are usually unique to the source and are stored exactly
* as returned from the data store.
* \param len Field length
* \param prec Field precision. Usually decimal places but may also be
* used in conjunction with other fields types (e.g., variable character fields)
* \param comment Comment for the field
* \param subType If the field is a collection, its element's type. When
* all the elements don't need to have the same type, leave
* this to QVariant::Invalid.
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED QgsField( const QString &name,
QVariant::Type type,
const QString &typeName = QString(),
int len = 0,
int prec = 0,
const QString &comment = QString(),
QVariant::Type subType = QVariant::Invalid );
QVariant::Type subType = QVariant::Invalid ) SIP_DEPRECATED;
/**
* Copy constructor
@ -273,14 +290,15 @@ class CORE_EXPORT QgsField
void setName( const QString &name ) SIP_HOLDGIL;
/**
* Set variant type.
* Set variant \a type.
*/
void setType( QMetaType::Type type ) SIP_HOLDGIL;
/**
* Set variant type.
* Set variant \a type.
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED void setType( QVariant::Type type );
Q_DECL_DEPRECATED void setType( QVariant::Type type ) SIP_DEPRECATED;
/**
* If the field is a collection, set its element's type.
@ -293,8 +311,9 @@ class CORE_EXPORT QgsField
* 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.
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED void setSubType( QVariant::Type subType );
Q_DECL_DEPRECATED void setSubType( QVariant::Type subType ) SIP_DEPRECATED;
/**
* Set the field type.

View File

@ -458,8 +458,9 @@ class CORE_EXPORT QgsFields
* Since QGIS 3.30, the optional \a typeString argument can be used to specify field type strings for handling user field types.
*
* \since QGIS 3.16
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED static QIcon iconForFieldType( QVariant::Type type, QVariant::Type subType, const QString &typeString = QString() );
Q_DECL_DEPRECATED static QIcon iconForFieldType( QVariant::Type type, QVariant::Type subType, const QString &typeString = QString() ) SIP_DEPRECATED;
//! Allows direct construction of QVariants from fields.
operator QVariant() const

View File

@ -371,8 +371,9 @@ class CORE_EXPORT QgsJsonUtils
* \param type optional variant type of the elements, if specified (and not Invalid),
* the array items will be converted to the type, and discarded if
* the conversion is not possible.
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED Q_INVOKABLE static QVariantList parseArray( const QString &json, QVariant::Type type );
Q_INVOKABLE Q_DECL_DEPRECATED static QVariantList parseArray( const QString &json, QVariant::Type type ) SIP_DEPRECATED;
/**
* Parses a GeoJSON "geometry" value to a QgsGeometry object.

View File

@ -43,8 +43,9 @@ class CORE_EXPORT QgsVariantUtils
* Returns a user-friendly translated string representing a QVariant \a type.
*
* The optional \a subType can be used to specify the type of variant list or map values.
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED static QString typeToDisplayString( QVariant::Type type, QVariant::Type subType = QVariant::Type::Invalid );
Q_DECL_DEPRECATED static QString typeToDisplayString( QVariant::Type type, QVariant::Type subType = QVariant::Type::Invalid ) SIP_DEPRECATED;
/**
* Returns TRUE if the specified \a variant should be considered a NULL value.

View File

@ -98,8 +98,9 @@ class CORE_EXPORT QgsRasterAttributeTable
/**
* Creates a new Field with \a name, \a type and \a usage.
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED Field( const QString &name, const Qgis::RasterAttributeTableFieldUsage &usage, const QVariant::Type type ): Field( name, usage, QgsVariantUtils::variantTypeToMetaType( type ) ) {}
Q_DECL_DEPRECATED Field( const QString &name, const Qgis::RasterAttributeTableFieldUsage &usage, const QVariant::Type type ) SIP_DEPRECATED: Field( name, usage, QgsVariantUtils::variantTypeToMetaType( type ) ) {}
/**
* Returns TRUE if the field carries a color component (Red, Green, Blue and optionally Alpha) information.
@ -255,8 +256,9 @@ class CORE_EXPORT QgsRasterAttributeTable
/**
* Creates a new field from \a name, \a usage and \a type and inserts it at \a position, optionally reporting any error in \a errorMessage, returns TRUE on success.
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED bool insertField( int position, const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QVariant::Type type, QString *errorMessage SIP_OUT = nullptr );
Q_DECL_DEPRECATED bool insertField( int position, const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QVariant::Type type, QString *errorMessage SIP_OUT = nullptr ) SIP_DEPRECATED;
/**
* Create RGBA fields and inserts them at \a position, optionally reporting any error in \a errorMessage, returns TRUE on success.

View File

@ -65,10 +65,11 @@ class CORE_EXPORT QgsFieldDomain
/**
* Constructor for QgsFieldDomain, with the specified \a name, \a description and \a fieldType.
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED QgsFieldDomain( const QString &name,
const QString &description,
QVariant::Type fieldType );
QVariant::Type fieldType ) SIP_DEPRECATED;
virtual ~QgsFieldDomain();
@ -133,8 +134,9 @@ class CORE_EXPORT QgsFieldDomain
* Sets the associated field \a type.
*
* \see fieldType()
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED void setFieldType( QVariant::Type type );
Q_DECL_DEPRECATED void setFieldType( QVariant::Type type ) SIP_DEPRECATED;
/**
* Returns the split policy.
@ -257,11 +259,12 @@ class CORE_EXPORT QgsCodedFieldDomain : public QgsFieldDomain
*
* The \a values list details the coded field values as QgsCodedValue objects. Each code should
* appear only once, but it is the responsibility of the user to check this.
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED QgsCodedFieldDomain( const QString &name,
const QString &description,
QVariant::Type fieldType,
const QList<QgsCodedValue> &values );
const QList<QgsCodedValue> &values ) SIP_DEPRECATED;
#ifndef SIP_RUN
//! QgsCodedFieldDomain cannot be copied - use clone() instead
@ -333,6 +336,7 @@ class CORE_EXPORT QgsRangeFieldDomain : public QgsFieldDomain
* Constructor for QgsRangeFieldDomain, with the specified \a name, \a description and \a fieldType.
*
* Set an invalid QVariant for \a minimum or \a maximum respectively if no minimum or maximum value is desired.
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED QgsRangeFieldDomain( const QString &name,
const QString &description,
@ -340,7 +344,7 @@ class CORE_EXPORT QgsRangeFieldDomain : public QgsFieldDomain
const QVariant &minimum,
bool minimumIsInclusive,
const QVariant &maximum,
bool maximumIsInclusive );
bool maximumIsInclusive ) SIP_DEPRECATED;
#ifndef SIP_RUN
@ -477,11 +481,12 @@ class CORE_EXPORT QgsGlobFieldDomain : public QgsFieldDomain
* Constructor for QgsGlobFieldDomain, with the specified \a name, \a description and \a fieldType.
*
* The \a glob argument specifies the content validation glob, e.g. "*[a-z][0-1]?".
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED QgsGlobFieldDomain( const QString &name,
const QString &description,
QVariant::Type fieldType,
const QString &glob );
const QString &glob ) SIP_DEPRECATED;
#ifndef SIP_RUN

View File

@ -495,11 +495,11 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider, public QgsFeat
, mMaxLen( maxLen )
, mMinPrec( minPrec )
, mMaxPrec( maxPrec )
, mSubType( QgsVariantUtils::variantTypeToMetaType( subType ) )
{}
, mSubType( QgsVariantUtils::variantTypeToMetaType( subType ) ) SIP_DEPRECATED
{}
QString mTypeDesc;
QString mTypeDesc;
QString mTypeName;
QMetaType::Type mType;
int mMinLen;
@ -572,9 +572,17 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider, public QgsFeat
*/
virtual QgsAbstractVectorLayerLabeling *createLabeling( const QVariantMap &configuration = QVariantMap() ) const SIP_FACTORY;
/**
* Convert \a value to \a type
*/
static QVariant convertValue( QMetaType::Type type, const QString &value );
Q_DECL_DEPRECATED static QVariant convertValue( QVariant::Type type, const QString &value );
/**
* Convert \a value to \a type
*
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED static QVariant convertValue( QVariant::Type type, const QString &value ) SIP_DEPRECATED;
/**
* Returns the transaction this data provider is included in, if any.

View File

@ -47,8 +47,9 @@ class GUI_EXPORT QgsAggregateToolButton : public QToolButton
/**
* Based on the \a type of underlying data, some aggregates will be available or not.
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED void setType( QVariant::Type type );
Q_DECL_DEPRECATED void setType( QVariant::Type type ) SIP_DEPRECATED;
/**
* Based on the \a type of underlying data, some aggregates will be available or not.

View File

@ -96,8 +96,9 @@ class GUI_EXPORT QgsExternalResourceWidget : public QWidget
/**
* \brief documentPath returns the path of the current document in the widget
* \param type determines the type of the returned null variant if the document is not defined yet
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED QVariant documentPath( QVariant::Type type ) const;
Q_DECL_DEPRECATED QVariant documentPath( QVariant::Type type ) const SIP_DEPRECATED;
void setDocumentPath( const QVariant &documentPath );

View File

@ -100,8 +100,9 @@ class GUI_EXPORT QgsRasterAttributeTableModel : public QAbstractTableModel
* \param position insertion point (before)
* \param errorMessage optional error message
* \returns true on success
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED bool insertField( const int position, const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QVariant::Type type, QString *errorMessage SIP_OUT = nullptr );
Q_DECL_DEPRECATED bool insertField( const int position, const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QVariant::Type type, QString *errorMessage SIP_OUT = nullptr ) SIP_DEPRECATED;
/**
* Remove the field at given \a position, optionally reporting any error in \a errorMessage, returns TRUE on success.

View File

@ -48,9 +48,10 @@ class SERVER_EXPORT QgsServerParameterDefinition
* Constructor for QgsServerParameterDefinition.
* \param type The type of the parameter
* \param defaultValue The default value of the parameter
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED QgsServerParameterDefinition( const QVariant::Type type,
const QVariant defaultValue = QVariant( "" ) );
const QVariant defaultValue = QVariant( "" ) ) SIP_DEPRECATED;
/**
@ -228,10 +229,11 @@ class SERVER_EXPORT QgsServerParameter : public QgsServerParameterDefinition
* \param name The name of the parameter
* \param type The type of the parameter
* \param defaultValue The default value to use if not defined
* \deprecated since QGIS 3.38, use the method with a QMetaType::Type argument instead
*/
Q_DECL_DEPRECATED QgsServerParameter( const QgsServerParameter::Name name,
const QVariant::Type type,
const QVariant defaultValue = QVariant( "" ) );
const QVariant defaultValue = QVariant( "" ) ) SIP_DEPRECATED;
/**
* Raises an error in case of an invalid conversion.