Skip to content

Commit

Permalink
add missing QgsExpression import when exporting model as Python script
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry authored and nyalldawson committed Oct 25, 2019
1 parent eac4354 commit eefa2cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/core/processing/models/qgsprocessingmodelalgorithm.cpp
Expand Up @@ -632,6 +632,7 @@ QStringList QgsProcessingModelAlgorithm::asPythonCode( const QgsProcessing::Pyth
static QMap< QString, QString > sAdditionalImports
{
{ QStringLiteral( "QgsCoordinateReferenceSystem" ), QStringLiteral( "from qgis.core import QgsCoordinateReferenceSystem" ) },
{ QStringLiteral( "QgsExpression" ), QStringLiteral( "from qgis.core import QgsExpression" ) },
{ QStringLiteral( "QgsRectangle" ), QStringLiteral( "from qgis.core import QgsRectangle" ) },
{ QStringLiteral( "QgsReferencedRectangle" ), QStringLiteral( "from qgis.core import QgsReferencedRectangle" ) },
{ QStringLiteral( "QgsPoint" ), QStringLiteral( "from qgis.core import QgsPoint" ) },
Expand Down
1 change: 1 addition & 0 deletions tests/src/analysis/testqgsprocessing.cpp
Expand Up @@ -7760,6 +7760,7 @@ void TestQgsProcessing::modelExecution()
"from qgis.core import QgsProcessingParameterCrs\n"
"from qgis.core import QgsProcessingParameterFeatureSink\n"
"from qgis.core import QgsCoordinateReferenceSystem\n"
"from qgis.core import QgsExpression\n"
"import processing\n"
"\n"
"\n"
Expand Down

0 comments on commit eefa2cd

Please sign in to comment.