Skip to content

Commit

Permalink
convert QVariant::Type to QMetaType::Type
Browse files Browse the repository at this point in the history
  • Loading branch information
troopa81 committed Nov 27, 2024
1 parent f493164 commit 7c65f3d
Show file tree
Hide file tree
Showing 138 changed files with 1,682 additions and 1,684 deletions.
1 change: 1 addition & 0 deletions python/core/auto_generated/actions/qgsactionscope.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ Returns if this scope is valid.

.. versionadded:: 3.0
%End

long __hash__();
%MethodCode
sipRes = qHash( *sipCpp );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Abstract base class for storage of elevation profiles.
%End
public:

QgsProfileRenderContext( QgsRenderContext &context );
QgsProfileRenderContext( const QgsRenderContext &context );
%Docstring
Constructor for QgsProfileRenderContext, with the specified embedded render ``context``.
%End
Expand Down
4 changes: 2 additions & 2 deletions python/core/auto_generated/expression/qgsexpression.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ quotations where required.
.. versionadded:: 2.14
%End

static QString quotedValue( const QVariant &value, QVariant::Type type );
static QString quotedValue( const QVariant &value, QMetaType::Type type );
%Docstring
Returns a string representation of a literal value, including appropriate
quotations where required.
Expand Down Expand Up @@ -691,7 +691,7 @@ length, and presents text representations of non numeric/text types (e.g., geome
.. versionadded:: 2.14
%End

static QString createFieldEqualityExpression( const QString &fieldName, const QVariant &value, QVariant::Type fieldType = QVariant::Type::Invalid );
static QString createFieldEqualityExpression( const QString &fieldName, const QVariant &value, QMetaType::Type fieldType = QMetaType::UnknownType );
%Docstring
Create an expression allowing to evaluate if a field is equal to a
value. The value may be null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,24 @@ Default constructor of field formatter for a date time field.
virtual QString representValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;


static QString defaultFormat( QVariant::Type type );
static QString defaultFormat( QMetaType::Type type );
%Docstring
Gets the default format in function of the type.
The type is expected to be one of

- QVariant.DateTime
- QVariant.Date
- QVariant.Time
- QMetaType.QDateTime
- QMetaType.QDate
- QMetaType.QTime
%End

static QString defaultDisplayFormat( QVariant::Type type );
static QString defaultDisplayFormat( QMetaType::Type type );
%Docstring
Gets the default display format in function of the type.
The type is expected to be one of

- QVariant.DateTime
- QVariant.Date
- QVariant.Time
- QMetaType.QDateTime
- QMetaType.QDate
- QMetaType.QTime

.. versionadded:: 3.30
%End
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/geometry/qgsbox3d.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ Returns the smallest distance between the box and the point ``point``

bool operator==( const QgsBox3D &other ) const /HoldGIL/;

void scale( double scaleFactor, const QgsPoint &center = QgsPoint() ) /HoldGIL/;
void scale( double scaleFactor, const QgsPoint &center = {} ) /HoldGIL/;
%Docstring
Scale the rectangle around a ``center`` :py:class:`QgsPoint`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ Returns the area of the quadrilateral, or 0 if the quadrilateral is empty.
%Docstring
Returns the perimeter of the quadrilateral, or 0 if the quadrilateral is empty.
%End

SIP_PYOBJECT __repr__();
%MethodCode
QString str = QStringLiteral( "<QgsQuadrilateral: %1>" ).arg( sipCpp->toString() );
Expand Down
4 changes: 0 additions & 4 deletions python/core/auto_generated/geometry/qgswkbptr.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ A const WKB pointer.
%TypeHeaderCode
#include "qgswkbptr.h"
%End
protected:



public:
QgsConstWkbPtr( const unsigned char *p /Array/, int size /ArraySize/ );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Returns the data type
.. seealso:: :py:func:`variantType`
%End

QVariant::Type variantType() const;
QMetaType::Type variantType() const;
%Docstring
Returns the most suitable equivalent QVariant data type to this attribute type.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Utility functions for working with ArcGIS REST services.

public:

static QVariant::Type convertFieldType( const QString &type );
static QMetaType::Type convertFieldType( const QString &type );
%Docstring
Converts an ESRI REST field ``type`` to a QVariant type.
%End
Expand Down Expand Up @@ -187,7 +187,7 @@ Converts a ``feature`` to an ArcGIS REST JSON representation.
.. versionadded:: 3.28
%End

static QVariant variantToAttributeValue( const QVariant &variant, QVariant::Type expectedType, const QgsArcGisRestContext &context );
static QVariant variantToAttributeValue( const QVariant &variant, QMetaType::Type expectedType, const QgsArcGisRestContext &context );
%Docstring
Converts a variant to a REST attribute value.

Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsaggregatecalculator.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ to a data provider for remote calculation.
{
QString function;
QString name;
QSet<QVariant::Type> supportedTypes;
QSet<QMetaType::Type> supportedTypes;
};

enum Aggregate
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsapplication.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ differently across work stations.
This string is used to represent the value `NULL` throughout QGIS.

In general, when passing values around, prefer to use a null QVariant
`QVariant( field.type() )` or `QVariant( QVariant.Int )`. This value
`QVariant( field.type() )` or `QVariant( QMetaType.Int )`. This value
should only be used in the final presentation step when showing values
in a widget or sending it to a web browser.
%End
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsattributes.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ typedef QVector<QVariant> QgsAttributes;
PyObject *obj = PyList_GET_ITEM( sipPy, i );
if ( obj == Py_None )
{
qv->append( QVariant( QVariant::Int ) );
qv->append( QVariant( QMetaType::Int ) );
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions python/core/auto_generated/qgsfeature.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ geometry and a list of field/values attributes.

if ( a1Wrapper == Py_None )
{
rv = sipCpp->setAttribute( a0, QVariant( QVariant::Int ) );
rv = sipCpp->setAttribute( a0, QVariant( QMetaType::Int ) );
}
else
{
Expand All @@ -103,7 +103,7 @@ geometry and a list of field/values attributes.
{
if ( a1Wrapper == Py_None )
{
sipCpp->setAttribute( *a0, QVariant( QVariant::Int ) );
sipCpp->setAttribute( *a0, QVariant( QMetaType::Int ) );
}
else
{
Expand Down Expand Up @@ -310,7 +310,7 @@ Alternatively, in Python it is possible to directly set a field's value via the

if ( a1Wrapper == Py_None )
{
rv = sipCpp->setAttribute( a0, QVariant( QVariant::Int ) );
rv = sipCpp->setAttribute( a0, QVariant( QMetaType::Int ) );
}
else
{
Expand Down Expand Up @@ -565,7 +565,7 @@ Alternatively, in Python it is possible to directly set a field's value via the
{
if ( a1Wrapper == Py_None )
{
sipCpp->setAttribute( *a0, QVariant( QVariant::Int ) );
sipCpp->setAttribute( *a0, QVariant( QMetaType::Int ) );
}
else
{
Expand Down
20 changes: 11 additions & 9 deletions python/core/auto_generated/qgsfield.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ length, and if applicable, precision.


QgsField( const QString &name = QString(),
QVariant::Type type = QVariant::Invalid,
QMetaType::Type type = QMetaType::UnknownType,
const QString &typeName = QString(),
int len = 0,
int prec = 0,
const QString &comment = QString(),
QVariant::Type subType = QVariant::Invalid );
QMetaType::Type subType = QMetaType::UnknownType );
%Docstring
Constructor. Constructs a new QgsField object.

Expand All @@ -56,14 +56,16 @@ Constructor. Constructs a new QgsField object.
: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.
this to QMetaType.UnknownType.
%End

QgsField( const QgsField &other );
%Docstring
Copy constructor
%End

QVariant testVariant( QMetaType::Type type );


virtual ~QgsField();

Expand Down Expand Up @@ -133,16 +135,16 @@ length, precision or constraint information.
.. versionadded:: 3.14
%End

QVariant::Type type() const;
QMetaType::Type type() const;
%Docstring
Gets variant type of the field as it will be retrieved from data source
%End

QVariant::Type subType() const;
QMetaType::Type subType() const;
%Docstring
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.
QMetaType.UnknownType.

.. versionadded:: 3.0
%End
Expand Down Expand Up @@ -239,16 +241,16 @@ Set the field name.
:param name: Name of the field
%End

void setType( QVariant::Type type );
void setType( QMetaType::Type type );
%Docstring
Set variant type.
%End

void setSubType( QVariant::Type subType );
void setSubType( QMetaType::Type subType );
%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.
QMetaType.UnknownType.

.. versionadded:: 3.0
%End
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsfields.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ Returns an icon corresponding to a field index, based on the field's type and so
}
%End

static QIcon iconForFieldType( QVariant::Type type, QVariant::Type subType = QVariant::Type::Invalid, const QString &typeString = QString() );
static QIcon iconForFieldType( QMetaType::Type type, QMetaType::Type subType = QMetaType::UnknownType, const QString &typeString = QString() );
%Docstring
Returns an icon corresponding to a field ``type``

Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsjsonutils.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ Exports all attributes from a :py:class:`QgsFeature` as a JSON map type.
%End


static QVariantList parseArray( const QString &json, QVariant::Type type = QVariant::Invalid );
static QVariantList parseArray( const QString &json, QMetaType::Type type = QMetaType::UnknownType );
%Docstring
Parse a simple array (depth=1)

Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsvariantutils.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Contains utility functions for working with QVariants and QVariant types.
%End
public:

static QString typeToDisplayString( QVariant::Type type, QVariant::Type subType = QVariant::Type::Invalid );
static QString typeToDisplayString( QMetaType::Type type, QMetaType::Type subType = QMetaType::UnknownType );
%Docstring
Returns a user-friendly translated string representing a QVariant ``type``.

Expand Down
8 changes: 4 additions & 4 deletions python/core/auto_generated/qgsxmlutils.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ Write a QVariant to a QDomElement.

Supported types are

- QVariant.Map
- QVariant.Int
- QVariant.Double
- QVariant.String
- QMetaType.QVariantMap
- QMetaType.Int
- QMetaType.Double
- QMetaType.QString
- :py:class:`QgsProperty` (since QGIS 3.4)
- :py:class:`QgsCoordinateReferenceSystem` (since QGIS 3.4)
%End
Expand Down
12 changes: 6 additions & 6 deletions python/core/auto_generated/raster/qgsrasterattributetable.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The UsageInformation class represents information about a field usage.

bool maybeClass;

QList<QVariant::Type> allowedTypes;
QList<QMetaType::Type> allowedTypes;
};

class Field
Expand All @@ -68,7 +68,7 @@ The Field class represents a Raster Attribute Table field, including its name, u
%End
public:

Field( const QString &name, const Qgis::RasterAttributeTableFieldUsage &usage, const QVariant::Type type );
Field( const QString &name, const Qgis::RasterAttributeTableFieldUsage &usage, const QMetaType::Type type );
%Docstring
Creates a new Field with ``name``, ``type`` and ``usage``.
%End
Expand All @@ -85,7 +85,7 @@ Returns ``True`` if the field carries a color ramp component information (RedMin

QString name;
Qgis::RasterAttributeTableFieldUsage usage;
QVariant::Type type;
QMetaType::Type type;
};

class MinMaxClass
Expand Down Expand Up @@ -250,7 +250,7 @@ Inserts a new ``field`` at ``position``, optionally reporting any error in ``err
Out of range position is automatically clamped to a valid value.
%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 QMetaType::Type type, QString *errorMessage /Out/ = 0 );
%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.
%End
Expand All @@ -272,7 +272,7 @@ Change the usage of the field at index ``fieldIndex`` to ``usage`` with checks f
Create RGBA minimum and maximum fields and inserts them at ``position``, optionally reporting any error in ``errorMessage``, returns ``True`` on success.
%End

bool appendField( const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QVariant::Type type, QString *errorMessage /Out/ = 0 );
bool appendField( const QString &name, const Qgis::RasterAttributeTableFieldUsage usage, const QMetaType::Type type, QString *errorMessage /Out/ = 0 );
%Docstring
Creates a new field from ``name``, ``usage`` and ``type`` and appends it to the fields, optionally reporting any error in ``errorMessage``, returns ``True`` on success.
%End
Expand Down Expand Up @@ -408,7 +408,7 @@ If the attribute table does not have any value field (and hence is not valid),
the current data are returned without any change.
%End

static Qgis::RasterAttributeTableFieldUsage guessFieldUsage( const QString &name, const QVariant::Type type );
static Qgis::RasterAttributeTableFieldUsage guessFieldUsage( const QString &name, const QMetaType::Type type );
%Docstring
Try to determine the field usage from its ``name`` and ``type``.
%End
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@





class QgsTextFragment
{
%Docstring(signature="appended")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Abstract base class for bounding volumes for tiled scene nodes.
default:
sipType = 0;
break;
};
}
%End

virtual ~QgsAbstractTiledSceneBoundingVolume();
Expand Down
Loading

0 comments on commit 7c65f3d

Please sign in to comment.