mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-05 00:04:40 -05:00
Promote some processing enums to enum class, cleanups
This commit is contained in:
parent
26798b84f4
commit
a36b203f30
@ -12,9 +12,18 @@ QgsProcessing.TypePlugin = QgsProcessing.SourceType.TypePlugin
|
||||
QgsProcessing.TypePointCloud = QgsProcessing.SourceType.TypePointCloud
|
||||
QgsProcessing.TypeAnnotation = QgsProcessing.SourceType.TypeAnnotation
|
||||
QgsProcessing.TypeVectorTile = QgsProcessing.SourceType.TypeVectorTile
|
||||
# monkey patching scoped based enum
|
||||
QgsProcessing.PythonQgsProcessingAlgorithmSubclass = QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass
|
||||
QgsProcessing.PythonQgsProcessingAlgorithmSubclass.is_monkey_patched = True
|
||||
QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass.__doc__ = "Full Python QgsProcessingAlgorithm subclass"
|
||||
QgsProcessing.PythonOutputType.__doc__ = "Available Python output types\n\n" + '* ``PythonQgsProcessingAlgorithmSubclass``: ' + QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass.__doc__
|
||||
# --
|
||||
QgsProcessing.PythonOutputType.baseClass = QgsProcessing
|
||||
# monkey patching scoped based enum
|
||||
QgsProcessing.LayerOptionsFlag.SkipIndexGeneration.__doc__ = "Do not generate index when creating a layer. Makes sense only for point cloud layers"
|
||||
QgsProcessing.LayerOptionsFlag.__doc__ = "Layer options flags\n\n.. versionadded:: 3.32\n\n" + '* ``SkipIndexGeneration``: ' + QgsProcessing.LayerOptionsFlag.SkipIndexGeneration.__doc__
|
||||
# --
|
||||
QgsProcessing.LayerOptionsFlag.baseClass = QgsProcessing
|
||||
QgsProcessing.LayerOptionsFlags = lambda flags=0: QgsProcessing.LayerOptionsFlag(flags)
|
||||
QgsProcessing.LayerOptionsFlags.baseClass = QgsProcessing
|
||||
LayerOptionsFlags = QgsProcessing # dirty hack since SIP seems to introduce the flags in module
|
||||
|
||||
@ -26,5 +26,6 @@ QgsProcessingUtils.TiledScene.is_monkey_patched = True
|
||||
QgsProcessingUtils.LayerHint.TiledScene.__doc__ = "Tiled scene layer type, since QGIS 3.34"
|
||||
QgsProcessingUtils.LayerHint.__doc__ = "Layer type hints.\n\n.. versionadded:: 3.4\n\n" + '* ``UnknownType``: ' + QgsProcessingUtils.LayerHint.UnknownType.__doc__ + '\n' + '* ``Vector``: ' + QgsProcessingUtils.LayerHint.Vector.__doc__ + '\n' + '* ``Raster``: ' + QgsProcessingUtils.LayerHint.Raster.__doc__ + '\n' + '* ``Mesh``: ' + QgsProcessingUtils.LayerHint.Mesh.__doc__ + '\n' + '* ``PointCloud``: ' + QgsProcessingUtils.LayerHint.PointCloud.__doc__ + '\n' + '* ``Annotation``: ' + QgsProcessingUtils.LayerHint.Annotation.__doc__ + '\n' + '* ``VectorTile``: ' + QgsProcessingUtils.LayerHint.VectorTile.__doc__ + '\n' + '* ``TiledScene``: ' + QgsProcessingUtils.LayerHint.TiledScene.__doc__
|
||||
# --
|
||||
QgsProcessingUtils.LayerHint.baseClass = QgsProcessingUtils
|
||||
QgsProcessingFeatureSource.FlagSkipGeometryValidityChecks = QgsProcessingFeatureSource.Flag.FlagSkipGeometryValidityChecks
|
||||
QgsProcessingFeatureSource.Flags = lambda flags=0: QgsProcessingFeatureSource.Flag(flags)
|
||||
|
||||
@ -24,6 +24,9 @@ and parameters.
|
||||
%TypeHeaderCode
|
||||
#include "qgsprocessing.h"
|
||||
%End
|
||||
public:
|
||||
static const QMetaObject staticMetaObject;
|
||||
|
||||
public:
|
||||
|
||||
enum SourceType
|
||||
@ -43,7 +46,7 @@ and parameters.
|
||||
TypeVectorTile
|
||||
};
|
||||
|
||||
enum PythonOutputType
|
||||
enum class PythonOutputType
|
||||
{
|
||||
PythonQgsProcessingAlgorithmSubclass,
|
||||
};
|
||||
|
||||
@ -36,7 +36,7 @@ Constructor for QgsProcessingParameterAggregate.
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QMap<QString, QVariant> toVariantMap() const;
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ Constructor for QgsProcessingParameterAlignRasterLayers.
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ Constructor for QgsProcessingParameterDxfLayers.
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ Constructor for QgsProcessingParameterFieldMapping.
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QMap<QString, QVariant> toVariantMap() const;
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ Constructor
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
@ -128,7 +128,7 @@ Constructor
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
|
||||
@ -599,7 +599,7 @@ Returns the parameter definition encoded in a string which can be used within a
|
||||
Processing script.
|
||||
%End
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
%Docstring
|
||||
Returns the parameter definition as a Python command which can be used within a
|
||||
Python Processing script.
|
||||
@ -1899,7 +1899,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QMap<QString, QVariant> toVariantMap() const;
|
||||
|
||||
@ -1983,7 +1983,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -2094,7 +2094,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
QStringList headers() const;
|
||||
@ -2198,7 +2198,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -2299,7 +2299,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString toolTip() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
double minimum() const;
|
||||
@ -2403,7 +2403,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
QString parentParameterName() const;
|
||||
@ -2478,7 +2478,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString type() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
Qgis::TemporalUnit defaultUnit() const;
|
||||
@ -2535,7 +2535,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString type() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
static QgsProcessingParameterScale *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
|
||||
@ -2577,7 +2577,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
QgsProcessingParameterNumber::Type dataType() const;
|
||||
@ -2698,7 +2698,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
QStringList options() const;
|
||||
@ -2812,7 +2812,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
bool multiLine() const;
|
||||
@ -2916,7 +2916,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
QString parentLayerParameterName() const;
|
||||
@ -3038,7 +3038,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QVariant valueAsJsonObject( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -3137,7 +3137,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -3200,7 +3200,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
@ -3321,7 +3321,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -3366,7 +3366,7 @@ output will not be created by default.
|
||||
|
||||
virtual bool fromVariantMap( const QMap<QString, QVariant> &map );
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -3496,7 +3496,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString defaultFileExtension() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -3614,7 +3614,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString defaultFileExtension() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -3773,7 +3773,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString defaultFileExtension() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -3884,7 +3884,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
QString parentLayerParameterName() const;
|
||||
@ -3965,7 +3965,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
static QgsProcessingParameterLayout *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
|
||||
@ -4011,7 +4011,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QMap<QString, QVariant> toVariantMap() const;
|
||||
|
||||
@ -4094,7 +4094,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
|
||||
|
||||
@ -4164,7 +4164,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
@ -4288,7 +4288,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QMap<QString, QVariant> toVariantMap() const;
|
||||
|
||||
@ -4350,7 +4350,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString toolTip() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
QDateTime minimum() const;
|
||||
@ -4464,7 +4464,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QMap<QString, QVariant> toVariantMap() const;
|
||||
|
||||
@ -4535,7 +4535,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QMap<QString, QVariant> toVariantMap() const;
|
||||
|
||||
@ -4613,7 +4613,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QMap<QString, QVariant> toVariantMap() const;
|
||||
|
||||
@ -4850,7 +4850,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ Constructor
|
||||
|
||||
virtual QVariant valueAsJsonObject( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
static QString typeName();
|
||||
|
||||
@ -48,7 +48,7 @@ Constructor for QgsProcessingParameterVectorTileWriterLayers.
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
static QString typeName();
|
||||
|
||||
@ -23,6 +23,9 @@ Utility functions for use with processing classes.
|
||||
%TypeHeaderCode
|
||||
#include "qgsprocessingutils.h"
|
||||
%End
|
||||
public:
|
||||
static const QMetaObject staticMetaObject;
|
||||
|
||||
public:
|
||||
|
||||
static QList< QgsRasterLayer * > compatibleRasterLayers( QgsProject *project, bool sort = true );
|
||||
|
||||
@ -1,5 +1,15 @@
|
||||
# The following has been generated automatically from src/core/processing/qgsprocessing.h
|
||||
# monkey patching scoped based enum
|
||||
QgsProcessing.PythonQgsProcessingAlgorithmSubclass = QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass
|
||||
QgsProcessing.PythonQgsProcessingAlgorithmSubclass.is_monkey_patched = True
|
||||
QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass.__doc__ = "Full Python QgsProcessingAlgorithm subclass"
|
||||
QgsProcessing.PythonOutputType.__doc__ = "Available Python output types\n\n" + '* ``PythonQgsProcessingAlgorithmSubclass``: ' + QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass.__doc__
|
||||
# --
|
||||
QgsProcessing.PythonOutputType.baseClass = QgsProcessing
|
||||
# monkey patching scoped based enum
|
||||
QgsProcessing.LayerOptionsFlag.SkipIndexGeneration.__doc__ = "Do not generate index when creating a layer. Makes sense only for point cloud layers"
|
||||
QgsProcessing.LayerOptionsFlag.__doc__ = "Layer options flags\n\n.. versionadded:: 3.32\n\n" + '* ``SkipIndexGeneration``: ' + QgsProcessing.LayerOptionsFlag.SkipIndexGeneration.__doc__
|
||||
# --
|
||||
QgsProcessing.LayerOptionsFlag.baseClass = QgsProcessing
|
||||
QgsProcessing.LayerOptionsFlags.baseClass = QgsProcessing
|
||||
LayerOptionsFlags = QgsProcessing # dirty hack since SIP seems to introduce the flags in module
|
||||
|
||||
@ -26,3 +26,4 @@ QgsProcessingUtils.TiledScene.is_monkey_patched = True
|
||||
QgsProcessingUtils.LayerHint.TiledScene.__doc__ = "Tiled scene layer type, since QGIS 3.34"
|
||||
QgsProcessingUtils.LayerHint.__doc__ = "Layer type hints.\n\n.. versionadded:: 3.4\n\n" + '* ``UnknownType``: ' + QgsProcessingUtils.LayerHint.UnknownType.__doc__ + '\n' + '* ``Vector``: ' + QgsProcessingUtils.LayerHint.Vector.__doc__ + '\n' + '* ``Raster``: ' + QgsProcessingUtils.LayerHint.Raster.__doc__ + '\n' + '* ``Mesh``: ' + QgsProcessingUtils.LayerHint.Mesh.__doc__ + '\n' + '* ``PointCloud``: ' + QgsProcessingUtils.LayerHint.PointCloud.__doc__ + '\n' + '* ``Annotation``: ' + QgsProcessingUtils.LayerHint.Annotation.__doc__ + '\n' + '* ``VectorTile``: ' + QgsProcessingUtils.LayerHint.VectorTile.__doc__ + '\n' + '* ``TiledScene``: ' + QgsProcessingUtils.LayerHint.TiledScene.__doc__
|
||||
# --
|
||||
QgsProcessingUtils.LayerHint.baseClass = QgsProcessingUtils
|
||||
|
||||
@ -24,6 +24,9 @@ and parameters.
|
||||
%TypeHeaderCode
|
||||
#include "qgsprocessing.h"
|
||||
%End
|
||||
public:
|
||||
static const QMetaObject staticMetaObject;
|
||||
|
||||
public:
|
||||
|
||||
enum SourceType
|
||||
@ -43,7 +46,7 @@ and parameters.
|
||||
TypeVectorTile
|
||||
};
|
||||
|
||||
enum PythonOutputType
|
||||
enum class PythonOutputType
|
||||
{
|
||||
PythonQgsProcessingAlgorithmSubclass,
|
||||
};
|
||||
|
||||
@ -36,7 +36,7 @@ Constructor for QgsProcessingParameterAggregate.
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QVariantMap toVariantMap() const;
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ Constructor for QgsProcessingParameterAlignRasterLayers.
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ Constructor for QgsProcessingParameterDxfLayers.
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ Constructor for QgsProcessingParameterFieldMapping.
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QVariantMap toVariantMap() const;
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ Constructor
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
@ -128,7 +128,7 @@ Constructor
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
|
||||
@ -599,7 +599,7 @@ Returns the parameter definition encoded in a string which can be used within a
|
||||
Processing script.
|
||||
%End
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
%Docstring
|
||||
Returns the parameter definition as a Python command which can be used within a
|
||||
Python Processing script.
|
||||
@ -1899,7 +1899,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QVariantMap toVariantMap() const;
|
||||
|
||||
@ -1983,7 +1983,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -2094,7 +2094,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
QStringList headers() const;
|
||||
@ -2198,7 +2198,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -2299,7 +2299,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString toolTip() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
double minimum() const;
|
||||
@ -2403,7 +2403,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
QString parentParameterName() const;
|
||||
@ -2478,7 +2478,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString type() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
Qgis::TemporalUnit defaultUnit() const;
|
||||
@ -2535,7 +2535,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString type() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
static QgsProcessingParameterScale *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
|
||||
@ -2577,7 +2577,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
QgsProcessingParameterNumber::Type dataType() const;
|
||||
@ -2698,7 +2698,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
QStringList options() const;
|
||||
@ -2812,7 +2812,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
bool multiLine() const;
|
||||
@ -2916,7 +2916,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
QString parentLayerParameterName() const;
|
||||
@ -3038,7 +3038,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QVariant valueAsJsonObject( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -3137,7 +3137,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -3200,7 +3200,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
@ -3321,7 +3321,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -3366,7 +3366,7 @@ output will not be created by default.
|
||||
|
||||
virtual bool fromVariantMap( const QVariantMap &map );
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -3496,7 +3496,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString defaultFileExtension() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -3614,7 +3614,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString defaultFileExtension() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -3773,7 +3773,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString defaultFileExtension() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QString createFileFilter() const;
|
||||
|
||||
@ -3884,7 +3884,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
QString parentLayerParameterName() const;
|
||||
@ -3965,7 +3965,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
static QgsProcessingParameterLayout *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
|
||||
@ -4011,7 +4011,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QVariantMap toVariantMap() const;
|
||||
|
||||
@ -4094,7 +4094,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
|
||||
|
||||
@ -4164,7 +4164,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
@ -4288,7 +4288,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QVariantMap toVariantMap() const;
|
||||
|
||||
@ -4350,7 +4350,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString toolTip() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
QDateTime minimum() const;
|
||||
@ -4464,7 +4464,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QVariantMap toVariantMap() const;
|
||||
|
||||
@ -4535,7 +4535,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QVariantMap toVariantMap() const;
|
||||
|
||||
@ -4613,7 +4613,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QVariantMap toVariantMap() const;
|
||||
|
||||
@ -4850,7 +4850,7 @@ Returns the type name for the parameter class.
|
||||
|
||||
virtual QString asScriptCode() const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
virtual QStringList dependsOnOtherParameters() const;
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ Constructor
|
||||
|
||||
virtual QVariant valueAsJsonObject( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
static QString typeName();
|
||||
|
||||
@ -48,7 +48,7 @@ Constructor for QgsProcessingParameterVectorTileWriterLayers.
|
||||
|
||||
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
|
||||
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
|
||||
static QString typeName();
|
||||
|
||||
@ -23,6 +23,9 @@ Utility functions for use with processing classes.
|
||||
%TypeHeaderCode
|
||||
#include "qgsprocessingutils.h"
|
||||
%End
|
||||
public:
|
||||
static const QMetaObject staticMetaObject;
|
||||
|
||||
public:
|
||||
|
||||
static QList< QgsRasterLayer * > compatibleRasterLayers( QgsProject *project, bool sort = true );
|
||||
|
||||
@ -682,7 +682,7 @@ QStringList QgsProcessingModelAlgorithm::asPythonCode( const QgsProcessing::Pyth
|
||||
QStringList importLines; // not a set - we need regular ordering
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
// add specific parameter type imports
|
||||
const auto params = parameterDefinitions();
|
||||
@ -898,7 +898,7 @@ QStringList QgsProcessingModelAlgorithm::asPythonCode( const QgsProcessing::Pyth
|
||||
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
lines << currentIndent + QStringLiteral( "return results" );
|
||||
lines << QString();
|
||||
|
||||
|
||||
@ -39,6 +39,7 @@
|
||||
|
||||
class CORE_EXPORT QgsProcessing
|
||||
{
|
||||
Q_GADGET
|
||||
|
||||
public:
|
||||
|
||||
@ -61,10 +62,11 @@ class CORE_EXPORT QgsProcessing
|
||||
};
|
||||
|
||||
//! Available Python output types
|
||||
enum PythonOutputType
|
||||
enum class PythonOutputType SIP_MONKEYPATCH_SCOPEENUM
|
||||
{
|
||||
PythonQgsProcessingAlgorithmSubclass, //!< Full Python QgsProcessingAlgorithm subclass
|
||||
};
|
||||
Q_ENUM( PythonOutputType )
|
||||
|
||||
/**
|
||||
* Layer options flags
|
||||
@ -75,7 +77,9 @@ class CORE_EXPORT QgsProcessing
|
||||
{
|
||||
SkipIndexGeneration = 1 << 0, //!< Do not generate index when creating a layer. Makes sense only for point cloud layers
|
||||
};
|
||||
Q_ENUM( LayerOptionsFlag )
|
||||
Q_DECLARE_FLAGS( LayerOptionsFlags, LayerOptionsFlag )
|
||||
Q_FLAG( LayerOptionsFlags )
|
||||
|
||||
/**
|
||||
* Converts a source \a type to a string representation.
|
||||
|
||||
@ -15,8 +15,6 @@
|
||||
|
||||
#include "qgsprocessingparameteraggregate.h"
|
||||
|
||||
#include "qgsvectorlayer.h"
|
||||
|
||||
|
||||
QgsProcessingParameterAggregate::QgsProcessingParameterAggregate( const QString &name, const QString &description, const QString &parentLayerParameterName, bool optional )
|
||||
: QgsProcessingParameterDefinition( name, description, QVariant(), optional )
|
||||
@ -72,7 +70,7 @@ QString QgsProcessingParameterAggregate::asPythonString( QgsProcessing::PythonOu
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterAggregate('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
|
||||
@ -38,7 +38,7 @@ class CORE_EXPORT QgsProcessingParameterAggregate : public QgsProcessingParamete
|
||||
QString type() const override;
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QVariantMap toVariantMap() const override;
|
||||
bool fromVariantMap( const QVariantMap &map ) override;
|
||||
QStringList dependsOnOtherParameters() const override;
|
||||
|
||||
@ -142,7 +142,7 @@ QString QgsProcessingParameterAlignRasterLayers::asPythonString( QgsProcessing::
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterAlignRasterLayers('%1', %2)" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
|
||||
@ -54,7 +54,7 @@ class CORE_EXPORT QgsProcessingParameterAlignRasterLayers : public QgsProcessing
|
||||
QString type() const override;
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
QVariant valueAsJsonObject( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
|
||||
|
||||
@ -143,7 +143,7 @@ QString QgsProcessingParameterDxfLayers::asPythonString( QgsProcessing::PythonOu
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterDxfLayers('%1', %2)" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
|
||||
@ -52,7 +52,7 @@ class CORE_EXPORT QgsProcessingParameterDxfLayers : public QgsProcessingParamete
|
||||
QString type() const override;
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
QVariant valueAsJsonObject( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
|
||||
|
||||
@ -15,9 +15,6 @@
|
||||
|
||||
#include "qgsprocessingparameterfieldmap.h"
|
||||
|
||||
#include "qgsvectorlayer.h"
|
||||
|
||||
|
||||
QgsProcessingParameterFieldMapping::QgsProcessingParameterFieldMapping( const QString &name, const QString &description, const QString &parentLayerParameterName, bool optional )
|
||||
: QgsProcessingParameterDefinition( name, description, QVariant(), optional )
|
||||
, mParentLayerParameterName( parentLayerParameterName )
|
||||
@ -70,7 +67,7 @@ QString QgsProcessingParameterFieldMapping::asPythonString( QgsProcessing::Pytho
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterFieldMapping('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
|
||||
@ -38,7 +38,7 @@ class CORE_EXPORT QgsProcessingParameterFieldMapping : public QgsProcessingParam
|
||||
QString type() const override;
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QVariantMap toVariantMap() const override;
|
||||
bool fromVariantMap( const QVariantMap &map ) override;
|
||||
QStringList dependsOnOtherParameters() const override;
|
||||
|
||||
@ -59,7 +59,7 @@ QString QgsProcessingParameterMeshDatasetGroups::asPythonString( QgsProcessing::
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterMeshDatasetGroups('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -243,7 +243,7 @@ QString QgsProcessingParameterMeshDatasetTime::asPythonString( QgsProcessing::Py
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterMeshDatasetTime('%1', '%2'" )
|
||||
.arg( name(), description() );
|
||||
|
||||
@ -53,7 +53,7 @@ class CORE_EXPORT QgsProcessingParameterMeshDatasetGroups : public QgsProcessing
|
||||
QString type() const override;
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QStringList dependsOnOtherParameters() const override;
|
||||
QVariantMap toVariantMap() const override;
|
||||
bool fromVariantMap( const QVariantMap &map ) override;
|
||||
@ -163,7 +163,7 @@ class CORE_EXPORT QgsProcessingParameterMeshDatasetTime : public QgsProcessingPa
|
||||
QString type() const override;
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QStringList dependsOnOtherParameters() const override;
|
||||
QVariantMap toVariantMap() const override;
|
||||
bool fromVariantMap( const QVariantMap &map ) override;
|
||||
|
||||
@ -2943,7 +2943,7 @@ QString QgsProcessingParameterDefinition::asPythonString( const QgsProcessing::P
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = t->className() + QStringLiteral( "('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -3362,7 +3362,7 @@ QString QgsProcessingParameterMapLayer::asPythonString( const QgsProcessing::Pyt
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterMapLayer('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -3844,7 +3844,7 @@ QString QgsProcessingParameterGeometry::asPythonString( const QgsProcessing::Pyt
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterGeometry('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -4001,7 +4001,7 @@ QString QgsProcessingParameterFile::asPythonString( const QgsProcessing::PythonO
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
|
||||
QString code = QStringLiteral( "QgsProcessingParameterFile('%1', %2" )
|
||||
@ -4145,7 +4145,7 @@ QString QgsProcessingParameterMatrix::asPythonString( const QgsProcessing::Pytho
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterMatrix('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -4421,7 +4421,7 @@ QString QgsProcessingParameterMultipleLayers::asPythonString( const QgsProcessin
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterMultipleLayers('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -4601,7 +4601,7 @@ QString QgsProcessingParameterNumber::asPythonString( const QgsProcessing::Pytho
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterNumber('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -4759,7 +4759,7 @@ QString QgsProcessingParameterRange::asPythonString( const QgsProcessing::Python
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterRange('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -5156,7 +5156,7 @@ QString QgsProcessingParameterEnum::asPythonString( const QgsProcessing::PythonO
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterEnum('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -5303,7 +5303,7 @@ QString QgsProcessingParameterString::asPythonString( const QgsProcessing::Pytho
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterString('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -5458,7 +5458,7 @@ QString QgsProcessingParameterExpression::asPythonString( const QgsProcessing::P
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterExpression('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -5615,7 +5615,7 @@ QString QgsProcessingParameterVectorLayer::asPythonString( const QgsProcessing::
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterVectorLayer('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -5911,7 +5911,7 @@ QString QgsProcessingParameterField::asPythonString( const QgsProcessing::Python
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterField('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -6294,7 +6294,7 @@ QString QgsProcessingParameterFeatureSource::asPythonString( const QgsProcessing
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterFeatureSource('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -6523,7 +6523,7 @@ QString QgsProcessingParameterFeatureSink::asPythonString( const QgsProcessing::
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterFeatureSink('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -6908,7 +6908,7 @@ QString QgsProcessingParameterFileDestination::asPythonString( const QgsProcessi
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterFileDestination('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -7046,7 +7046,7 @@ QString QgsProcessingDestinationParameter::asPythonString( const QgsProcessing::
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
// base class method is probably not much use
|
||||
if ( QgsProcessingParameterType *t = QgsApplication::processingRegistry()->parameterType( type() ) )
|
||||
@ -7248,7 +7248,7 @@ QString QgsProcessingParameterVectorDestination::asPythonString( const QgsProces
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterVectorDestination('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -7489,7 +7489,7 @@ QString QgsProcessingParameterBand::asPythonString( const QgsProcessing::PythonO
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterBand('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -7594,7 +7594,7 @@ QString QgsProcessingParameterDistance::asPythonString( const QgsProcessing::Pyt
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterDistance('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -7665,7 +7665,7 @@ QString QgsProcessingParameterDuration::asPythonString( const QgsProcessing::Pyt
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterDuration('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -7723,7 +7723,7 @@ QString QgsProcessingParameterScale::asPythonString( const QgsProcessing::Python
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterScale('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -7784,7 +7784,7 @@ QString QgsProcessingParameterLayout::asPythonString( const QgsProcessing::Pytho
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterLayout('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -7863,7 +7863,7 @@ QString QgsProcessingParameterLayoutItem::asPythonString( QgsProcessing::PythonO
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterLayoutItem('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -8007,7 +8007,7 @@ QString QgsProcessingParameterColor::asPythonString( const QgsProcessing::Python
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterColor('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -8154,7 +8154,7 @@ QString QgsProcessingParameterCoordinateOperation::asPythonString( QgsProcessing
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QgsProcessingContext c;
|
||||
QString code = QStringLiteral( "QgsProcessingParameterCoordinateOperation('%1', %2" )
|
||||
@ -8279,7 +8279,7 @@ QString QgsProcessingParameterMapTheme::asPythonString( const QgsProcessing::Pyt
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterMapTheme('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -8461,7 +8461,7 @@ QString QgsProcessingParameterDateTime::asPythonString( const QgsProcessing::Pyt
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterDateTime('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -8596,7 +8596,7 @@ QString QgsProcessingParameterProviderConnection::asPythonString( const QgsProce
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterProviderConnection('%1', %2, '%3'" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ), mProviderId );
|
||||
@ -8712,7 +8712,7 @@ QString QgsProcessingParameterDatabaseSchema::asPythonString( const QgsProcessin
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterDatabaseSchema('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -8847,7 +8847,7 @@ QString QgsProcessingParameterDatabaseTable::asPythonString( const QgsProcessing
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterDatabaseTable('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
@ -9372,7 +9372,7 @@ QString QgsProcessingParameterPointCloudAttribute::asPythonString( const QgsProc
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterPointCloudAttribute('%1', %2" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
|
||||
@ -701,7 +701,7 @@ class CORE_EXPORT QgsProcessingParameterDefinition
|
||||
*
|
||||
* \since QGIS 3.6
|
||||
*/
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const;
|
||||
|
||||
/**
|
||||
* Saves this parameter to a QVariantMap. Subclasses should ensure that they call the base class
|
||||
@ -1948,7 +1948,7 @@ class CORE_EXPORT QgsProcessingParameterGeometry : public QgsProcessingParameter
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QVariantMap toVariantMap() const override;
|
||||
bool fromVariantMap( const QVariantMap &map ) override;
|
||||
|
||||
@ -2025,7 +2025,7 @@ class CORE_EXPORT QgsProcessingParameterFile : public QgsProcessingParameterDefi
|
||||
QString type() const override { return typeName(); }
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString createFileFilter() const override;
|
||||
|
||||
/**
|
||||
@ -2120,7 +2120,7 @@ class CORE_EXPORT QgsProcessingParameterMatrix : public QgsProcessingParameterDe
|
||||
QString type() const override { return typeName(); }
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
|
||||
/**
|
||||
* Returns a list of column headers (if set).
|
||||
@ -2208,7 +2208,7 @@ class CORE_EXPORT QgsProcessingParameterMultipleLayers : public QgsProcessingPar
|
||||
QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
QVariant valueAsJsonObject( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString createFileFilter() const override;
|
||||
|
||||
/**
|
||||
@ -2301,7 +2301,7 @@ class CORE_EXPORT QgsProcessingParameterNumber : public QgsProcessingParameterDe
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString toolTip() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
|
||||
/**
|
||||
* Returns the minimum value acceptable by the parameter.
|
||||
@ -2396,7 +2396,7 @@ class CORE_EXPORT QgsProcessingParameterDistance : public QgsProcessingParameter
|
||||
|
||||
QString type() const override;
|
||||
QStringList dependsOnOtherParameters() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
|
||||
/**
|
||||
* Returns the name of the parent parameter, or an empty string if this is not set.
|
||||
@ -2464,7 +2464,7 @@ class CORE_EXPORT QgsProcessingParameterDuration : public QgsProcessingParameter
|
||||
QgsProcessingParameterDuration *clone() const override SIP_FACTORY;
|
||||
|
||||
QString type() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
|
||||
/**
|
||||
* Returns the default duration unit for the parameter.
|
||||
@ -2518,7 +2518,7 @@ class CORE_EXPORT QgsProcessingParameterScale : public QgsProcessingParameterNum
|
||||
QgsProcessingParameterScale *clone() const override SIP_FACTORY;
|
||||
|
||||
QString type() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
|
||||
/**
|
||||
* Creates a new parameter using the definition from a script code.
|
||||
@ -2553,7 +2553,7 @@ class CORE_EXPORT QgsProcessingParameterRange : public QgsProcessingParameterDef
|
||||
QString type() const override { return typeName(); }
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
|
||||
/**
|
||||
* Returns the acceptable data type for the range.
|
||||
@ -2656,7 +2656,7 @@ class CORE_EXPORT QgsProcessingParameterEnum : public QgsProcessingParameterDefi
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString valueAsPythonComment( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
|
||||
/**
|
||||
* Returns the list of acceptable options for the parameter.
|
||||
@ -2759,7 +2759,7 @@ class CORE_EXPORT QgsProcessingParameterString : public QgsProcessingParameterDe
|
||||
QString type() const override { return typeName(); }
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
|
||||
/**
|
||||
* Returns TRUE if the parameter allows multiline strings.
|
||||
@ -2851,7 +2851,7 @@ class CORE_EXPORT QgsProcessingParameterExpression : public QgsProcessingParamet
|
||||
QString type() const override { return typeName(); }
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QStringList dependsOnOtherParameters() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
|
||||
/**
|
||||
* Returns the name of the parent layer parameter, or an empty string if this is not set.
|
||||
@ -2959,7 +2959,7 @@ class CORE_EXPORT QgsProcessingParameterVectorLayer : public QgsProcessingParame
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
QVariant valueAsJsonObject( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString createFileFilter() const override;
|
||||
|
||||
QVariantMap toVariantMap() const override;
|
||||
@ -3036,7 +3036,7 @@ class CORE_EXPORT QgsProcessingParameterMapLayer : public QgsProcessingParameter
|
||||
QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
QVariant valueAsJsonObject( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString createFileFilter() const override;
|
||||
|
||||
QVariantMap toVariantMap() const override;
|
||||
@ -3089,7 +3089,7 @@ class CORE_EXPORT QgsProcessingParameterField : public QgsProcessingParameterDef
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QStringList dependsOnOtherParameters() const override;
|
||||
|
||||
/**
|
||||
@ -3196,7 +3196,7 @@ class CORE_EXPORT QgsProcessingParameterFeatureSource : public QgsProcessingPara
|
||||
QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
QVariant valueAsJsonObject( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString createFileFilter() const override;
|
||||
|
||||
QVariantMap toVariantMap() const override;
|
||||
@ -3232,7 +3232,7 @@ class CORE_EXPORT QgsProcessingDestinationParameter : public QgsProcessingParame
|
||||
bool isDestination() const override { return true; }
|
||||
QVariantMap toVariantMap() const override;
|
||||
bool fromVariantMap( const QVariantMap &map ) override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString createFileFilter() const override;
|
||||
|
||||
/**
|
||||
@ -3362,7 +3362,7 @@ class CORE_EXPORT QgsProcessingParameterFeatureSink : public QgsProcessingDestin
|
||||
QString asScriptCode() const override;
|
||||
QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
|
||||
QString defaultFileExtension() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString createFileFilter() const override;
|
||||
|
||||
/**
|
||||
@ -3460,7 +3460,7 @@ class CORE_EXPORT QgsProcessingParameterVectorDestination : public QgsProcessing
|
||||
QString asScriptCode() const override;
|
||||
QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
|
||||
QString defaultFileExtension() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString createFileFilter() const override;
|
||||
|
||||
/**
|
||||
@ -3596,7 +3596,7 @@ class CORE_EXPORT QgsProcessingParameterFileDestination : public QgsProcessingDe
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
|
||||
QString defaultFileExtension() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString createFileFilter() const override;
|
||||
|
||||
/**
|
||||
@ -3689,7 +3689,7 @@ class CORE_EXPORT QgsProcessingParameterBand : public QgsProcessingParameterDefi
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QStringList dependsOnOtherParameters() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
|
||||
/**
|
||||
* Returns the name of the parent layer parameter, or an empty string if this is not set.
|
||||
@ -3760,7 +3760,7 @@ class CORE_EXPORT QgsProcessingParameterLayout : public QgsProcessingParameterDe
|
||||
QString type() const override { return typeName(); }
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
|
||||
/**
|
||||
* Creates a new parameter using the definition from a script code.
|
||||
@ -3800,7 +3800,7 @@ class CORE_EXPORT QgsProcessingParameterLayoutItem : public QgsProcessingParamet
|
||||
QString type() const override { return typeName(); }
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QVariantMap toVariantMap() const override;
|
||||
bool fromVariantMap( const QVariantMap &map ) override;
|
||||
QStringList dependsOnOtherParameters() const override;
|
||||
@ -3875,7 +3875,7 @@ class CORE_EXPORT QgsProcessingParameterColor : public QgsProcessingParameterDef
|
||||
QString type() const override { return typeName(); }
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QVariantMap toVariantMap() const override;
|
||||
bool fromVariantMap( const QVariantMap &map ) override;
|
||||
@ -3938,7 +3938,7 @@ class CORE_EXPORT QgsProcessingParameterCoordinateOperation : public QgsProcessi
|
||||
QString type() const override { return typeName(); }
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QStringList dependsOnOtherParameters() const override;
|
||||
|
||||
QVariantMap toVariantMap() const override;
|
||||
@ -4043,7 +4043,7 @@ class CORE_EXPORT QgsProcessingParameterMapTheme : public QgsProcessingParameter
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QVariantMap toVariantMap() const override;
|
||||
bool fromVariantMap( const QVariantMap &map ) override;
|
||||
|
||||
@ -4099,7 +4099,7 @@ class CORE_EXPORT QgsProcessingParameterDateTime : public QgsProcessingParameter
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString toolTip() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
|
||||
/**
|
||||
* Returns the minimum value acceptable by the parameter.
|
||||
@ -4205,7 +4205,7 @@ class CORE_EXPORT QgsProcessingParameterProviderConnection : public QgsProcessin
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QVariantMap toVariantMap() const override;
|
||||
bool fromVariantMap( const QVariantMap &map ) override;
|
||||
|
||||
@ -4266,7 +4266,7 @@ class CORE_EXPORT QgsProcessingParameterDatabaseSchema : public QgsProcessingPar
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QVariantMap toVariantMap() const override;
|
||||
bool fromVariantMap( const QVariantMap &map ) override;
|
||||
QStringList dependsOnOtherParameters() const override;
|
||||
@ -4333,7 +4333,7 @@ class CORE_EXPORT QgsProcessingParameterDatabaseTable : public QgsProcessingPara
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QVariantMap toVariantMap() const override;
|
||||
bool fromVariantMap( const QVariantMap &map ) override;
|
||||
QStringList dependsOnOtherParameters() const override;
|
||||
@ -4533,7 +4533,7 @@ class CORE_EXPORT QgsProcessingParameterPointCloudAttribute : public QgsProcessi
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asScriptCode() const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QStringList dependsOnOtherParameters() const override;
|
||||
|
||||
/**
|
||||
|
||||
@ -99,7 +99,7 @@ QString QgsProcessingParameterTinInputLayers::asPythonString( QgsProcessing::Pyt
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterTinInputLayers('%1', %2)" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
|
||||
@ -62,7 +62,7 @@ class CORE_EXPORT QgsProcessingParameterTinInputLayers: public QgsProcessingPara
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
QVariant valueAsJsonObject( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
|
||||
//! Returns the type name for the parameter class.
|
||||
static QString typeName() { return QStringLiteral( "tininputlayers" ); }
|
||||
|
||||
@ -94,7 +94,7 @@ QString QgsProcessingParameterVectorTileWriterLayers::asPythonString( QgsProcess
|
||||
{
|
||||
switch ( outputType )
|
||||
{
|
||||
case QgsProcessing::PythonQgsProcessingAlgorithmSubclass:
|
||||
case QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass:
|
||||
{
|
||||
QString code = QStringLiteral( "QgsProcessingParameterVectorTileWriterLayers('%1', %2)" )
|
||||
.arg( name(), QgsProcessingUtils::stringToPythonLiteral( description() ) );
|
||||
|
||||
@ -51,7 +51,7 @@ class CORE_EXPORT QgsProcessingParameterVectorTileWriterLayers : public QgsProce
|
||||
QString type() const override;
|
||||
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
|
||||
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass ) const override;
|
||||
|
||||
//! Returns the type name for the parameter class.
|
||||
static QString typeName() { return QStringLiteral( "vectortilewriterlayers" ); }
|
||||
|
||||
@ -52,6 +52,8 @@ class QgsTiledSceneLayer;
|
||||
*/
|
||||
class CORE_EXPORT QgsProcessingUtils
|
||||
{
|
||||
Q_GADGET
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
@ -262,6 +264,7 @@ class CORE_EXPORT QgsProcessingUtils
|
||||
VectorTile, //!< Vector tile layer type, since QGIS 3.32
|
||||
TiledScene, //!< Tiled scene layer type, since QGIS 3.34
|
||||
};
|
||||
Q_ENUM( LayerHint )
|
||||
|
||||
/**
|
||||
* Interprets a string as a map layer within the supplied \a context.
|
||||
|
||||
@ -795,7 +795,7 @@ void QgsModelDesignerDialog::exportAsPython()
|
||||
const QFileInfo saveFileInfo( filename );
|
||||
settings.setValue( QStringLiteral( "lastModelDesignerExportDir" ), saveFileInfo.absolutePath(), QgsSettings::App );
|
||||
|
||||
const QString text = mModel->asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, 4 ).join( '\n' );
|
||||
const QString text = mModel->asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, 4 ).join( '\n' );
|
||||
|
||||
QFile outFile( filename );
|
||||
if ( !outFile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
|
||||
|
||||
@ -192,59 +192,59 @@ void TestQgsProcessingModelAlgorithm::modelerAlgorithm()
|
||||
svSource.setStaticValue( 7 );
|
||||
QCOMPARE( svSource.staticValue().toInt(), 7 );
|
||||
QMap< QString, QString > friendlyNames;
|
||||
QCOMPARE( svSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "7" ) );
|
||||
QCOMPARE( svSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "7" ) );
|
||||
svSource = QgsProcessingModelChildParameterSource::fromModelParameter( QStringLiteral( "a" ) );
|
||||
// check that calling setStaticValue flips source to StaticValue
|
||||
QCOMPARE( svSource.source(), Qgis::ProcessingModelChildParameterSource::ModelParameter );
|
||||
QCOMPARE( svSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "parameters['a']" ) );
|
||||
QCOMPARE( svSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "parameters['a']" ) );
|
||||
svSource.setStaticValue( 7 );
|
||||
QCOMPARE( svSource.staticValue().toInt(), 7 );
|
||||
QCOMPARE( svSource.source(), Qgis::ProcessingModelChildParameterSource::StaticValue );
|
||||
QCOMPARE( svSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "7" ) );
|
||||
QCOMPARE( svSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "7" ) );
|
||||
|
||||
// model parameter source
|
||||
QgsProcessingModelChildParameterSource mpSource = QgsProcessingModelChildParameterSource::fromModelParameter( QStringLiteral( "a" ) );
|
||||
QCOMPARE( mpSource.source(), Qgis::ProcessingModelChildParameterSource::ModelParameter );
|
||||
QCOMPARE( mpSource.parameterName(), QStringLiteral( "a" ) );
|
||||
QCOMPARE( mpSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "parameters['a']" ) );
|
||||
QCOMPARE( mpSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "parameters['a']" ) );
|
||||
mpSource.setParameterName( QStringLiteral( "b" ) );
|
||||
QCOMPARE( mpSource.parameterName(), QStringLiteral( "b" ) );
|
||||
QCOMPARE( mpSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "parameters['b']" ) );
|
||||
QCOMPARE( mpSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "parameters['b']" ) );
|
||||
mpSource = QgsProcessingModelChildParameterSource::fromStaticValue( 5 );
|
||||
// check that calling setParameterName flips source to ModelParameter
|
||||
QCOMPARE( mpSource.source(), Qgis::ProcessingModelChildParameterSource::StaticValue );
|
||||
QCOMPARE( mpSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "5" ) );
|
||||
QCOMPARE( mpSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "5" ) );
|
||||
mpSource.setParameterName( QStringLiteral( "c" ) );
|
||||
QCOMPARE( mpSource.parameterName(), QStringLiteral( "c" ) );
|
||||
QCOMPARE( mpSource.source(), Qgis::ProcessingModelChildParameterSource::ModelParameter );
|
||||
QCOMPARE( mpSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "parameters['c']" ) );
|
||||
QCOMPARE( mpSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "parameters['c']" ) );
|
||||
|
||||
// child alg output source
|
||||
QgsProcessingModelChildParameterSource oSource = QgsProcessingModelChildParameterSource::fromChildOutput( QStringLiteral( "a" ), QStringLiteral( "b" ) );
|
||||
QCOMPARE( oSource.source(), Qgis::ProcessingModelChildParameterSource::ChildOutput );
|
||||
QCOMPARE( oSource.outputChildId(), QStringLiteral( "a" ) );
|
||||
QCOMPARE( oSource.outputName(), QStringLiteral( "b" ) );
|
||||
QCOMPARE( oSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "outputs['a']['b']" ) );
|
||||
QCOMPARE( oSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "outputs['a']['b']" ) );
|
||||
// with friendly name
|
||||
friendlyNames.insert( QStringLiteral( "a" ), QStringLiteral( "alga" ) );
|
||||
QCOMPARE( oSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "outputs['alga']['b']" ) );
|
||||
QCOMPARE( oSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "outputs['alga']['b']" ) );
|
||||
oSource.setOutputChildId( QStringLiteral( "c" ) );
|
||||
QCOMPARE( oSource.outputChildId(), QStringLiteral( "c" ) );
|
||||
QCOMPARE( oSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "outputs['c']['b']" ) );
|
||||
QCOMPARE( oSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "outputs['c']['b']" ) );
|
||||
oSource.setOutputName( QStringLiteral( "d" ) );
|
||||
QCOMPARE( oSource.outputName(), QStringLiteral( "d" ) );
|
||||
QCOMPARE( oSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "outputs['c']['d']" ) );
|
||||
QCOMPARE( oSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "outputs['c']['d']" ) );
|
||||
oSource = QgsProcessingModelChildParameterSource::fromStaticValue( 5 );
|
||||
// check that calling setOutputChildId flips source to ChildOutput
|
||||
QCOMPARE( oSource.source(), Qgis::ProcessingModelChildParameterSource::StaticValue );
|
||||
QCOMPARE( oSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "5" ) );
|
||||
QCOMPARE( oSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "5" ) );
|
||||
oSource.setOutputChildId( QStringLiteral( "c" ) );
|
||||
QCOMPARE( oSource.outputChildId(), QStringLiteral( "c" ) );
|
||||
QCOMPARE( oSource.source(), Qgis::ProcessingModelChildParameterSource::ChildOutput );
|
||||
oSource = QgsProcessingModelChildParameterSource::fromStaticValue( 5 );
|
||||
// check that calling setOutputName flips source to ChildOutput
|
||||
QCOMPARE( oSource.source(), Qgis::ProcessingModelChildParameterSource::StaticValue );
|
||||
QCOMPARE( oSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "5" ) );
|
||||
QCOMPARE( oSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "5" ) );
|
||||
oSource.setOutputName( QStringLiteral( "d" ) );
|
||||
QCOMPARE( oSource.outputName(), QStringLiteral( "d" ) );
|
||||
QCOMPARE( oSource.source(), Qgis::ProcessingModelChildParameterSource::ChildOutput );
|
||||
@ -253,21 +253,21 @@ void TestQgsProcessingModelAlgorithm::modelerAlgorithm()
|
||||
QgsProcessingModelChildParameterSource expSource = QgsProcessingModelChildParameterSource::fromExpression( QStringLiteral( "1+2" ) );
|
||||
QCOMPARE( expSource.source(), Qgis::ProcessingModelChildParameterSource::Expression );
|
||||
QCOMPARE( expSource.expression(), QStringLiteral( "1+2" ) );
|
||||
QCOMPARE( expSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "QgsExpression('1+2').evaluate()" ) );
|
||||
QCOMPARE( expSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "QgsExpression('1+2').evaluate()" ) );
|
||||
expSource.setExpression( QStringLiteral( "1+3" ) );
|
||||
QCOMPARE( expSource.expression(), QStringLiteral( "1+3" ) );
|
||||
QCOMPARE( expSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "QgsExpression('1+3').evaluate()" ) );
|
||||
QCOMPARE( expSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "QgsExpression('1+3').evaluate()" ) );
|
||||
expSource.setExpression( QStringLiteral( "'a' || 'b\\'c'" ) );
|
||||
QCOMPARE( expSource.expression(), QStringLiteral( "'a' || 'b\\'c'" ) );
|
||||
QCOMPARE( expSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "QgsExpression(\"'a' || 'b\\\\'c'\").evaluate()" ) );
|
||||
QCOMPARE( expSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "QgsExpression(\"'a' || 'b\\\\'c'\").evaluate()" ) );
|
||||
expSource = QgsProcessingModelChildParameterSource::fromStaticValue( 5 );
|
||||
// check that calling setExpression flips source to Expression
|
||||
QCOMPARE( expSource.source(), Qgis::ProcessingModelChildParameterSource::StaticValue );
|
||||
QCOMPARE( expSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "5" ) );
|
||||
QCOMPARE( expSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "5" ) );
|
||||
expSource.setExpression( QStringLiteral( "1+4" ) );
|
||||
QCOMPARE( expSource.expression(), QStringLiteral( "1+4" ) );
|
||||
QCOMPARE( expSource.source(), Qgis::ProcessingModelChildParameterSource::Expression );
|
||||
QCOMPARE( expSource.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "QgsExpression('1+4').evaluate()" ) );
|
||||
QCOMPARE( expSource.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, nullptr, friendlyNames ), QStringLiteral( "QgsExpression('1+4').evaluate()" ) );
|
||||
|
||||
// source equality operator
|
||||
QVERIFY( QgsProcessingModelChildParameterSource::fromStaticValue( 5 ) ==
|
||||
@ -352,11 +352,11 @@ void TestQgsProcessingModelAlgorithm::modelerAlgorithm()
|
||||
QVERIFY( child.setAlgorithmId( QStringLiteral( "native:centroids" ) ) );
|
||||
QVERIFY( child.algorithm() );
|
||||
QCOMPARE( child.algorithm()->id(), QStringLiteral( "native:centroids" ) );
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, QgsStringMap(), 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " alg_params = {\n }\n outputs[''] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)" ) );
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, QgsStringMap(), 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " alg_params = {\n }\n outputs[''] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)" ) );
|
||||
QgsStringMap extraParams;
|
||||
extraParams[QStringLiteral( "SOMETHING" )] = QStringLiteral( "SOMETHING_ELSE" );
|
||||
extraParams[QStringLiteral( "SOMETHING2" )] = QStringLiteral( "SOMETHING_ELSE2" );
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, extraParams, 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " alg_params = {\n 'SOMETHING': SOMETHING_ELSE,\n 'SOMETHING2': SOMETHING_ELSE2\n }\n outputs[''] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)" ) );
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, extraParams, 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " alg_params = {\n 'SOMETHING': SOMETHING_ELSE,\n 'SOMETHING2': SOMETHING_ELSE2\n }\n outputs[''] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)" ) );
|
||||
// bit of a hack -- but try to simulate an algorithm not originally available!
|
||||
child.mAlgorithm.reset();
|
||||
QVERIFY( !child.algorithm() );
|
||||
@ -425,11 +425,11 @@ void TestQgsProcessingModelAlgorithm::modelerAlgorithm()
|
||||
QCOMPARE( child.parameterSources().value( QStringLiteral( "b" ) ).at( 0 ).staticValue().toInt(), 7 );
|
||||
QCOMPARE( child.parameterSources().value( QStringLiteral( "b" ) ).at( 1 ).staticValue().toInt(), 9 );
|
||||
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, extraParams, 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " # desc\n alg_params = {\n 'a': 5,\n 'b': [7,9],\n 'SOMETHING': SOMETHING_ELSE,\n 'SOMETHING2': SOMETHING_ELSE2\n }\n outputs['my_id'] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)" ) );
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, extraParams, 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " # desc\n alg_params = {\n 'a': 5,\n 'b': [7,9],\n 'SOMETHING': SOMETHING_ELSE,\n 'SOMETHING2': SOMETHING_ELSE2\n }\n outputs['my_id'] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)" ) );
|
||||
child.comment()->setDescription( QStringLiteral( "do\nsomething\n\nuseful" ) );
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, extraParams, 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " # desc\n # do\n # something\n # \n # useful\n alg_params = {\n 'a': 5,\n 'b': [7,9],\n 'SOMETHING': SOMETHING_ELSE,\n 'SOMETHING2': SOMETHING_ELSE2\n }\n outputs['my_id'] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)" ) );
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, extraParams, 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " # desc\n # do\n # something\n # \n # useful\n alg_params = {\n 'a': 5,\n 'b': [7,9],\n 'SOMETHING': SOMETHING_ELSE,\n 'SOMETHING2': SOMETHING_ELSE2\n }\n outputs['my_id'] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)" ) );
|
||||
child.comment()->setDescription( QStringLiteral( "do something useful" ) );
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, extraParams, 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " # desc\n # do something useful\n alg_params = {\n 'a': 5,\n 'b': [7,9],\n 'SOMETHING': SOMETHING_ELSE,\n 'SOMETHING2': SOMETHING_ELSE2\n }\n outputs['my_id'] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)" ) );
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, extraParams, 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " # desc\n # do something useful\n alg_params = {\n 'a': 5,\n 'b': [7,9],\n 'SOMETHING': SOMETHING_ELSE,\n 'SOMETHING2': SOMETHING_ELSE2\n }\n outputs['my_id'] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)" ) );
|
||||
|
||||
std::unique_ptr< QgsProcessingModelChildAlgorithm > childClone( child.clone() );
|
||||
QCOMPARE( childClone->toVariant(), child.toVariant() );
|
||||
@ -477,13 +477,13 @@ void TestQgsProcessingModelAlgorithm::modelerAlgorithm()
|
||||
QCOMPARE( child.modelOutput( QStringLiteral( "a" ) ).description(), QStringLiteral( "my output" ) );
|
||||
child.modelOutput( "a" ).setDescription( QStringLiteral( "my output 2" ) );
|
||||
QCOMPARE( child.modelOutput( "a" ).description(), QStringLiteral( "my output 2" ) );
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, extraParams, 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " # desc\n # do something useful\n alg_params = {\n 'a': 5,\n 'b': [7,9],\n 'SOMETHING': SOMETHING_ELSE,\n 'SOMETHING2': SOMETHING_ELSE2\n }\n outputs['my_id'] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)\n results['my_id:a'] = outputs['my_id']['']" ) );
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, extraParams, 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " # desc\n # do something useful\n alg_params = {\n 'a': 5,\n 'b': [7,9],\n 'SOMETHING': SOMETHING_ELSE,\n 'SOMETHING2': SOMETHING_ELSE2\n }\n outputs['my_id'] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)\n results['my_id:a'] = outputs['my_id']['']" ) );
|
||||
|
||||
// ensure friendly name is used if present
|
||||
child.addParameterSources( QStringLiteral( "b" ), QgsProcessingModelChildParameterSources() << QgsProcessingModelChildParameterSource::fromChildOutput( "a", "out" ) );
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, extraParams, 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " # desc\n # do something useful\n alg_params = {\n 'a': 5,\n 'b': outputs['alga']['out'],\n 'SOMETHING': SOMETHING_ELSE,\n 'SOMETHING2': SOMETHING_ELSE2\n }\n outputs['my_id'] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)\n results['my_id:a'] = outputs['my_id']['']" ) );
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, extraParams, 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " # desc\n # do something useful\n alg_params = {\n 'a': 5,\n 'b': outputs['alga']['out'],\n 'SOMETHING': SOMETHING_ELSE,\n 'SOMETHING2': SOMETHING_ELSE2\n }\n outputs['my_id'] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)\n results['my_id:a'] = outputs['my_id']['']" ) );
|
||||
friendlyNames.remove( QStringLiteral( "a" ) );
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, extraParams, 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " # desc\n # do something useful\n alg_params = {\n 'a': 5,\n 'b': outputs['a']['out'],\n 'SOMETHING': SOMETHING_ELSE,\n 'SOMETHING2': SOMETHING_ELSE2\n }\n outputs['my_id'] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)\n results['my_id:a'] = outputs['my_id']['']" ) );
|
||||
QCOMPARE( child.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, extraParams, 4, 2, friendlyNames, friendlyOutputNames ).join( '\n' ), QStringLiteral( " # desc\n # do something useful\n alg_params = {\n 'a': 5,\n 'b': outputs['a']['out'],\n 'SOMETHING': SOMETHING_ELSE,\n 'SOMETHING2': SOMETHING_ELSE2\n }\n outputs['my_id'] = processing.run('native:centroids', alg_params, context=context, feedback=feedback, is_child_algorithm=True)\n results['my_id:a'] = outputs['my_id']['']" ) );
|
||||
|
||||
// no existent
|
||||
child.modelOutput( QStringLiteral( "b" ) ).setDescription( QStringLiteral( "my output 3" ) );
|
||||
@ -1403,7 +1403,7 @@ void TestQgsProcessingModelAlgorithm::modelExecution()
|
||||
model2.childAlgorithm( QStringLiteral( "cx1" ) ).modelOutput( QStringLiteral( "MODEL_OUT_LAYER" ) ).setDescription( "my model output" );
|
||||
model2.updateDestinationParameters();
|
||||
model2.childAlgorithm( QStringLiteral( "cx1" ) ).setDescription( "first step in my model" );
|
||||
const QStringList actualParts = model2.asPythonCode( QgsProcessing::PythonQgsProcessingAlgorithmSubclass, 2 );
|
||||
const QStringList actualParts = model2.asPythonCode( QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass, 2 );
|
||||
QgsDebugMsgLevel( actualParts.join( '\n' ), 1 );
|
||||
const QStringList expectedParts = QStringLiteral( "\"\"\"\n"
|
||||
"Model exported as python.\n"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user