Skip to content
Permalink
Browse files

more flags warnings fixes for Qt 5.15 (#37309)

* more flags warnings fixes for Qt 5.15

* fix sip compilation
  • Loading branch information
3nids committed Jun 19, 2020
1 parent 3594980 commit 0cb840842511628ed66f5df73c3b6a49261c64b7
@@ -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.

@@ -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.

@@ -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.

@@ -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.

@@ -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.

@@ -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/;


@@ -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
@@ -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.

@@ -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``.

@@ -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.
@@ -318,7 +318,7 @@ class CORE_EXPORT QgsLayoutRenderContext : public QObject

private:

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

QgsLayout *mLayout = nullptr;

@@ -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.
@@ -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
@@ -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
@@ -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.
@@ -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.
@@ -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

@@ -146,7 +146,7 @@ class CORE_EXPORT QgsFieldConstraints
private:

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

//! Origin of field constraints
QHash< Constraint, ConstraintOrigin > mConstraintOrigins;
@@ -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.
@@ -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;
@@ -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;
@@ -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.
@@ -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();
@@ -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.
@@ -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:

@@ -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()
@@ -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.
@@ -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 );

@@ -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;
@@ -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.
@@ -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;

@@ -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 )
@@ -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;

@@ -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

0 comments on commit 0cb8408

Please sign in to comment.
You can’t perform that action at this time.