Skip to content

Commit

Permalink
more flags warnings fixes for Qt 5.15 (#37309)
Browse files Browse the repository at this point in the history
* more flags warnings fixes for Qt 5.15

* fix sip compilation
  • Loading branch information
3nids committed Jun 19, 2020
1 parent 3594980 commit 0cb8408
Show file tree
Hide file tree
Showing 27 changed files with 34 additions and 34 deletions.
Expand Up @@ -196,7 +196,7 @@ Sets the geometry from a WKT string.
typedef QFlags<QgsAbstractGeometry::WkbFlag> WkbFlags;


virtual QByteArray asWkb( WkbFlags flags = 0 ) const = 0;
virtual QByteArray asWkb( WkbFlags flags = QgsAbstractGeometry::WkbFlags() ) const = 0;
%Docstring
Returns a WKB representation of the geometry.

Expand Down
Expand Up @@ -662,7 +662,7 @@ Evaluates the parameter with matching ``name`` to a static boolean value.
%End

QgsFeatureSink *parameterAsSink( const QVariantMap &parameters, const QString &name, QgsProcessingContext &context, QString &destinationIdentifier /Out/,
const QgsFields &fields, QgsWkbTypes::Type geometryType = QgsWkbTypes::NoGeometry, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem(), QgsFeatureSink::SinkFlags sinkFlags = 0 ) const throw( QgsProcessingException ) /Factory/;
const QgsFields &fields, QgsWkbTypes::Type geometryType = QgsWkbTypes::NoGeometry, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem(), QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags() ) const throw( QgsProcessingException ) /Factory/;
%Docstring
Evaluates the parameter with matching ``name`` to a feature sink.

Expand Down
Expand Up @@ -837,7 +837,7 @@ Evaluates the parameter with matching ``definition`` and ``value`` to a static b

static QgsFeatureSink *parameterAsSink( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters,
const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs,
QgsProcessingContext &context, QString &destinationIdentifier /Out/, QgsFeatureSink::SinkFlags sinkFlags = 0 ) /Factory/;
QgsProcessingContext &context, QString &destinationIdentifier /Out/, QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags() ) /Factory/;
%Docstring
Evaluates the parameter with matching ``definition`` to a feature sink.

Expand All @@ -854,7 +854,7 @@ This function creates a new object and the caller takes responsibility for delet

static QgsFeatureSink *parameterAsSink( const QgsProcessingParameterDefinition *definition, const QVariant &value,
const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs,
QgsProcessingContext &context, QString &destinationIdentifier /Out/, QgsFeatureSink::SinkFlags sinkFlags = 0 ) throw( QgsProcessingException ) /Factory/;
QgsProcessingContext &context, QString &destinationIdentifier /Out/, QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags() ) throw( QgsProcessingException ) /Factory/;
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a feature sink.

Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsmapsettingsutils.sip.in
Expand Up @@ -30,7 +30,7 @@ Utilities for map settings.
typedef QFlags<QgsMapSettingsUtils::EffectsCheckFlag> EffectsCheckFlags;


static QStringList containsAdvancedEffects( const QgsMapSettings &mapSettings, EffectsCheckFlags flags = 0 );
static QStringList containsAdvancedEffects( const QgsMapSettings &mapSettings, EffectsCheckFlags flags = QgsMapSettingsUtils::EffectsCheckFlags() );
%Docstring
Checks whether any of the layers attached to a map settings object contain advanced effects.

Expand Down
4 changes: 2 additions & 2 deletions python/core/auto_generated/qgsvectorfilewriter.sip.in
Expand Up @@ -418,7 +418,7 @@ Writes a layer out to a vector file.
const QStringList &layerOptions = QStringList(),
QString *newFilename = 0,
QgsVectorFileWriter::SymbologyExport symbologyExport = QgsVectorFileWriter::NoSymbology,
QgsFeatureSink::SinkFlags sinkFlags = 0
QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags()
) /Deprecated/;


Expand All @@ -429,7 +429,7 @@ Writes a layer out to a vector file.
const QgsCoordinateReferenceSystem &srs,
const QgsCoordinateTransformContext &transformContext,
const QgsVectorFileWriter::SaveVectorOptions &options,
QgsFeatureSink::SinkFlags sinkFlags = 0,
QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(),
QString *newFilename = 0,
QString *newLayer = 0 );
%Docstring
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsvectorlayerexporter.sip.in
Expand Up @@ -77,7 +77,7 @@ Writes the contents of vector layer to a different datasource.
const QgsCoordinateReferenceSystem &crs,
bool overwrite = false,
const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
QgsFeatureSink::SinkFlags sinkFlags = 0 );
QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags() );
%Docstring
Constructor for QgsVectorLayerExporter.

Expand Down
Expand Up @@ -36,7 +36,7 @@ the components related to the GUI behavior of a layout item.
typedef QFlags<QgsLayoutItemAbstractGuiMetadata::Flag> Flags;


QgsLayoutItemAbstractGuiMetadata( int type, const QString &visibleName, const QString &groupId = QString(), bool isNodeBased = false, Flags flags = 0 );
QgsLayoutItemAbstractGuiMetadata( int type, const QString &visibleName, const QString &groupId = QString(), bool isNodeBased = false, Flags flags = QgsLayoutItemAbstractGuiMetadata::Flags() );
%Docstring
Constructor for QgsLayoutItemAbstractGuiMetadata with the specified class ``type``.

Expand Down
2 changes: 1 addition & 1 deletion src/core/geometry/qgsabstractgeometry.h
Expand Up @@ -259,7 +259,7 @@ class CORE_EXPORT QgsAbstractGeometry
* \see asJson()
* \since QGIS 3.0
*/
virtual QByteArray asWkb( WkbFlags flags = nullptr ) const = 0;
virtual QByteArray asWkb( WkbFlags flags = QgsAbstractGeometry::WkbFlags() ) const = 0;

/**
* Returns a WKT representation of the geometry.
Expand Down
2 changes: 1 addition & 1 deletion src/core/layout/qgslayoutrendercontext.h
Expand Up @@ -318,7 +318,7 @@ class CORE_EXPORT QgsLayoutRenderContext : public QObject

private:

Flags mFlags = nullptr;
Flags mFlags = Flags();

QgsLayout *mLayout = nullptr;

Expand Down
2 changes: 1 addition & 1 deletion src/core/processing/qgsprocessingalgorithm.h
Expand Up @@ -684,7 +684,7 @@ class CORE_EXPORT QgsProcessingAlgorithm
* \throws QgsProcessingException
*/
QgsFeatureSink *parameterAsSink( const QVariantMap &parameters, const QString &name, QgsProcessingContext &context, QString &destinationIdentifier SIP_OUT,
const QgsFields &fields, QgsWkbTypes::Type geometryType = QgsWkbTypes::NoGeometry, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem(), QgsFeatureSink::SinkFlags sinkFlags = nullptr ) const SIP_THROW( QgsProcessingException ) SIP_FACTORY;
const QgsFields &fields, QgsWkbTypes::Type geometryType = QgsWkbTypes::NoGeometry, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem(), QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags() ) const SIP_THROW( QgsProcessingException ) SIP_FACTORY;

/**
* Evaluates the parameter with matching \a name to a feature source.
Expand Down
2 changes: 1 addition & 1 deletion src/core/processing/qgsprocessingcontext.h
Expand Up @@ -532,7 +532,7 @@ class CORE_EXPORT QgsProcessingContext

private:

QgsProcessingContext::Flags mFlags = nullptr;
QgsProcessingContext::Flags mFlags = QgsProcessingContext::Flags();
QPointer< QgsProject > mProject;
QgsCoordinateTransformContext mTransformContext;
//! Temporary project owned by the context, used for storing temporarily loaded map layers
Expand Down
6 changes: 3 additions & 3 deletions src/core/processing/qgsprocessingparameters.h
Expand Up @@ -134,7 +134,7 @@ class CORE_EXPORT QgsProcessingFeatureSourceDefinition
*
* \since QGIS 3.14
*/
Flags flags = nullptr;
Flags flags = Flags();

/**
* Geometry check method to apply to this source. This setting is only
Expand Down Expand Up @@ -937,7 +937,7 @@ class CORE_EXPORT QgsProcessingParameters
*/
static QgsFeatureSink *parameterAsSink( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters,
const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs,
QgsProcessingContext &context, QString &destinationIdentifier SIP_OUT, QgsFeatureSink::SinkFlags sinkFlags = nullptr ) SIP_FACTORY;
QgsProcessingContext &context, QString &destinationIdentifier SIP_OUT, QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags() ) SIP_FACTORY;

/**
* Evaluates the parameter with matching \a definition and \a value to a feature sink.
Expand All @@ -956,7 +956,7 @@ class CORE_EXPORT QgsProcessingParameters
*/
static QgsFeatureSink *parameterAsSink( const QgsProcessingParameterDefinition *definition, const QVariant &value,
const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs,
QgsProcessingContext &context, QString &destinationIdentifier SIP_OUT, QgsFeatureSink::SinkFlags sinkFlags = nullptr ) SIP_THROW( QgsProcessingException ) SIP_FACTORY;
QgsProcessingContext &context, QString &destinationIdentifier SIP_OUT, QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags() ) SIP_THROW( QgsProcessingException ) SIP_FACTORY;

/**
* Evaluates the parameter with matching \a definition to a feature source.
Expand Down
2 changes: 1 addition & 1 deletion src/core/processing/qgsprocessingutils.h
Expand Up @@ -223,7 +223,7 @@ class CORE_EXPORT QgsProcessingUtils
QgsWkbTypes::Type geometryType,
const QgsCoordinateReferenceSystem &crs,
const QVariantMap &createOptions = QVariantMap(),
QgsFeatureSink::SinkFlags sinkFlags = nullptr,
QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(),
QgsRemappingSinkDefinition *remappingDefinition = nullptr ) SIP_FACTORY;
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsfieldconstraints.h
Expand Up @@ -146,7 +146,7 @@ class CORE_EXPORT QgsFieldConstraints
private:

//! Constraints
Constraints mConstraints = nullptr;
Constraints mConstraints;

//! Origin of field constraints
QHash< Constraint, ConstraintOrigin > mConstraintOrigins;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaplayer.h
Expand Up @@ -1569,7 +1569,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
//TODO QGIS 4 - move to readXml as a new argument (breaks API)

//! Read flags. It's up to the subclass to respect these when restoring state from XML
QgsMapLayer::ReadFlags mReadFlags = nullptr;
QgsMapLayer::ReadFlags mReadFlags = QgsMapLayer::ReadFlags();

/**
* TRUE if the layer's CRS should be validated and invalid CRSes are not permitted.
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsmaprendererstagedrenderjob.h
Expand Up @@ -59,7 +59,7 @@ class CORE_EXPORT QgsMapRendererStagedRenderJob : public QgsMapRendererAbstractC
*
* The optional \a flags argument can be used to control the staged render job behavior.
*/
QgsMapRendererStagedRenderJob( const QgsMapSettings &settings, Flags flags = nullptr );
QgsMapRendererStagedRenderJob( const QgsMapSettings &settings, Flags flags = Flags() );
~QgsMapRendererStagedRenderJob() override;

void start() override;
Expand Down Expand Up @@ -124,7 +124,7 @@ class CORE_EXPORT QgsMapRendererStagedRenderJob : public QgsMapRendererAbstractC

bool mNextIsLabel = false;
bool mExportedLabels = false;
Flags mFlags = nullptr;
Flags mFlags = Flags();
bool mPreparedStagedLabelJob = false;
QStringList mLabelingLayers;
QStringList::iterator mLabelLayerIt;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmapsettingsutils.h
Expand Up @@ -48,7 +48,7 @@ class CORE_EXPORT QgsMapSettingsUtils
*
* The optional \a flags argument can be used to fine-tune the check behavior.
*/
static QStringList containsAdvancedEffects( const QgsMapSettings &mapSettings, EffectsCheckFlags flags = nullptr );
static QStringList containsAdvancedEffects( const QgsMapSettings &mapSettings, EffectsCheckFlags flags = QgsMapSettingsUtils::EffectsCheckFlags() );

/**
* Computes the six parameters of a world file.
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsproject.cpp
Expand Up @@ -1145,7 +1145,7 @@ bool QgsProject::addLayer( const QDomElement &layerElem, QList<QDomNode> &broken
const bool layerWasStored { layerStore()->mapLayer( layerId ) != nullptr };

// have the layer restore state that is stored in Dom node
QgsMapLayer::ReadFlags layerFlags = nullptr;
QgsMapLayer::ReadFlags layerFlags = QgsMapLayer::ReadFlags();
if ( flags & QgsProject::ReadFlag::FlagDontResolveLayers )
layerFlags |= QgsMapLayer::FlagDontResolveLayers;
bool layerIsValid = mapLayer->readLayerXml( layerElem, context, layerFlags ) && mapLayer->isValid();
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsprojutils.h
Expand Up @@ -117,7 +117,7 @@ class CORE_EXPORT QgsProjUtils
*
* Returns TRUE if a matching authority and code was found.
*/
static bool identifyCrs( const PJ *crs, QString &authName, QString &authCode, IdentifyFlags flags = nullptr );
static bool identifyCrs( const PJ *crs, QString &authName, QString &authCode, IdentifyFlags flags = IdentifyFlags() );

/**
* Returns TRUE if a coordinate operation (specified via proj string) is available.
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgstemporalproperty.h
Expand Up @@ -71,7 +71,7 @@ class CORE_EXPORT QgsTemporalProperty : public QObject
/**
* Returns flags associated to the temporal property.
*/
virtual QgsTemporalProperty::Flags flags() const { return nullptr; }
virtual QgsTemporalProperty::Flags flags() const { return QgsTemporalProperty::Flags(); }

signals:

Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsvectorfilewriter.h
Expand Up @@ -563,7 +563,7 @@ class CORE_EXPORT QgsVectorFileWriter : public QgsFeatureSink
const QStringList &layerOptions = QStringList(),
QString *newFilename = nullptr,
QgsVectorFileWriter::SymbologyExport symbologyExport = QgsVectorFileWriter::NoSymbology,
QgsFeatureSink::SinkFlags sinkFlags = nullptr
QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags()
#ifndef SIP_RUN
, QString *newLayer = nullptr,
QgsCoordinateTransformContext transformContext = QgsCoordinateTransformContext()
Expand Down Expand Up @@ -606,7 +606,7 @@ class CORE_EXPORT QgsVectorFileWriter : public QgsFeatureSink
QgsVectorFileWriter::ActionOnExistingFile action,
QString *newLayer = nullptr,
QgsCoordinateTransformContext transformContext = QgsCoordinateTransformContext(),
QgsFeatureSink::SinkFlags sinkFlags = nullptr
QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags()
) SIP_SKIP;

//! QgsVectorFileWriter cannot be copied.
Expand All @@ -633,7 +633,7 @@ class CORE_EXPORT QgsVectorFileWriter : public QgsFeatureSink
const QgsCoordinateReferenceSystem &srs,
const QgsCoordinateTransformContext &transformContext,
const QgsVectorFileWriter::SaveVectorOptions &options,
QgsFeatureSink::SinkFlags sinkFlags = nullptr,
QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(),
QString *newFilename = nullptr,
QString *newLayer = nullptr );

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayerexporter.h
Expand Up @@ -106,7 +106,7 @@ class CORE_EXPORT QgsVectorLayerExporter : public QgsFeatureSink
const QgsCoordinateReferenceSystem &crs,
bool overwrite = false,
const QMap<QString, QVariant> &options = QMap<QString, QVariant>(),
QgsFeatureSink::SinkFlags sinkFlags = nullptr );
QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags() );

//! QgsVectorLayerExporter cannot be copied
QgsVectorLayerExporter( const QgsVectorLayerExporter &rh ) = delete;
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology/qgsrenderer.h
Expand Up @@ -271,7 +271,7 @@ class CORE_EXPORT QgsFeatureRenderer
* skip_the_curren_feature()
* \endcode
*/
virtual QgsFeatureRenderer::Capabilities capabilities() { return nullptr; }
virtual QgsFeatureRenderer::Capabilities capabilities() { return QgsFeatureRenderer::Capabilities(); }

/**
* Returns list of symbols used by the renderer.
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology/qgssymbol.h
Expand Up @@ -620,7 +620,7 @@ class CORE_EXPORT QgsSymbol
//! Symbol opacity (in the range 0 - 1)
qreal mOpacity = 1.0;

RenderHints mRenderHints = nullptr;
RenderHints mRenderHints;
bool mClipFeaturesToExtent = true;
bool mForceRHR = false;

Expand Down
2 changes: 1 addition & 1 deletion src/gui/layout/qgslayoutitemguiregistry.h
Expand Up @@ -63,7 +63,7 @@ class GUI_EXPORT QgsLayoutItemAbstractGuiMetadata
*
* If \a isNodeBased is TRUE, then the corresponding item is a node based item.
*/
QgsLayoutItemAbstractGuiMetadata( int type, const QString &visibleName, const QString &groupId = QString(), bool isNodeBased = false, Flags flags = nullptr )
QgsLayoutItemAbstractGuiMetadata( int type, const QString &visibleName, const QString &groupId = QString(), bool isNodeBased = false, Flags flags = QgsLayoutItemAbstractGuiMetadata::Flags() )
: mType( type )
, mGroupId( groupId )
, mIsNodeBased( isNodeBased )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/processing/models/qgsmodelgraphicsscene.h
Expand Up @@ -232,7 +232,7 @@ class GUI_EXPORT QgsModelGraphicsScene : public QGraphicsScene

void addCommentItemForComponent( QgsProcessingModelAlgorithm *model, const QgsProcessingModelComponent &component, QgsModelComponentGraphicItem *parentItem );

Flags mFlags = nullptr;
Flags mFlags = Flags();

QgsProcessingModelAlgorithm *mModel = nullptr;

Expand Down
2 changes: 1 addition & 1 deletion src/server/services/wms/qgswmsrendercontext.h
Expand Up @@ -261,7 +261,7 @@ namespace QgsWms
const QgsProject *mProject = nullptr;
QgsServerInterface *mInterface = nullptr;
QgsWmsParameters mParameters;
Flags mFlags = nullptr;
Flags mFlags = Flags();
double mScaleDenominator = -1.0;

// nickname of all layers defined within the project
Expand Down

0 comments on commit 0cb8408

Please sign in to comment.