mirror of
https://github.com/qgis/QGIS.git
synced 2025-06-19 00:02:48 -04:00
Port another member to c++
This commit is contained in:
parent
3249015fe1
commit
a8b364e2e2
@ -573,6 +573,8 @@ Copies are protected to avoid slicing
|
||||
|
||||
virtual bool canExecute( QString *errorMessage /Out/ = 0 ) const;
|
||||
|
||||
virtual QString asPythonCommand( const QVariantMap ¶meters, QgsProcessingContext &context ) const;
|
||||
|
||||
|
||||
void setName( const QString &name );
|
||||
%Docstring
|
||||
|
@ -224,12 +224,6 @@ class ModelerAlgorithm(QgsProcessingModelAlgorithm):
|
||||
v = value
|
||||
return param.evaluateForModeler(v, self)
|
||||
|
||||
def asPythonCommand(self, parameters, context):
|
||||
if self.sourceFilePath():
|
||||
return QgsProcessingAlgorithm.asPythonCommand(self, parameters, context)
|
||||
else:
|
||||
return None
|
||||
|
||||
def toPython(self):
|
||||
s = ['##%s=name' % self.name()]
|
||||
for param in list(self.parameterComponents().values()):
|
||||
|
@ -915,6 +915,14 @@ bool QgsProcessingModelAlgorithm::canExecute( QString *errorMessage ) const
|
||||
return true;
|
||||
}
|
||||
|
||||
QString QgsProcessingModelAlgorithm::asPythonCommand( const QVariantMap ¶meters, QgsProcessingContext &context ) const
|
||||
{
|
||||
if ( mSourceFile.isEmpty() )
|
||||
return QString(); // temporary model - can't run as python command
|
||||
|
||||
return QgsProcessingAlgorithm::asPythonCommand( parameters, context );
|
||||
}
|
||||
|
||||
|
||||
bool QgsProcessingModelAlgorithm::ChildParameterSource::operator==( const QgsProcessingModelAlgorithm::ChildParameterSource &other ) const
|
||||
{
|
||||
|
@ -573,6 +573,7 @@ class CORE_EXPORT QgsProcessingModelAlgorithm : public QgsProcessingAlgorithm
|
||||
QString helpUrl() const override;
|
||||
|
||||
bool canExecute( QString *errorMessage SIP_OUT = nullptr ) const override;
|
||||
QString asPythonCommand( const QVariantMap ¶meters, QgsProcessingContext &context ) const override;
|
||||
|
||||
/**
|
||||
* Sets the model \a name.
|
||||
|
Loading…
x
Reference in New Issue
Block a user