@@ -3471,8 +3471,8 @@ void TestQgsProcessing::modelerAlgorithm()
3471
3471
QgsProcessingModelAlgorithm::ModelOutput testModelOut;
3472
3472
testModelOut.setChildId ( QStringLiteral ( " my_id" ) );
3473
3473
QCOMPARE ( testModelOut.childId (), QStringLiteral ( " my_id" ) );
3474
- testModelOut.setOutputName ( QStringLiteral ( " my_output" ) );
3475
- QCOMPARE ( testModelOut.outputName (), QStringLiteral ( " my_output" ) );
3474
+ testModelOut.setChildOutputName ( QStringLiteral ( " my_output" ) );
3475
+ QCOMPARE ( testModelOut.childOutputName (), QStringLiteral ( " my_output" ) );
3476
3476
3477
3477
QMap<QString, QgsProcessingModelAlgorithm::ModelOutput> outputs;
3478
3478
QgsProcessingModelAlgorithm::ModelOutput out1;
@@ -3817,53 +3817,53 @@ void TestQgsProcessing::modelerAlgorithm()
3817
3817
alg7c1.setChildId ( " cx1" );
3818
3818
alg7c1.setAlgorithmId ( " native:centroids" );
3819
3819
QMap<QString, QgsProcessingModelAlgorithm::ModelOutput> alg7c1outputs;
3820
- QgsProcessingModelAlgorithm::ModelOutput alg7c1out1;
3820
+ QgsProcessingModelAlgorithm::ModelOutput alg7c1out1 ( QStringLiteral ( " my_output " ) ) ;
3821
3821
alg7c1out1.setChildId ( " cx1" );
3822
- alg7c1out1.setOutputName ( " OUTPUT_LAYER" );
3822
+ alg7c1out1.setChildOutputName ( " OUTPUT_LAYER" );
3823
3823
alg7c1out1.setDescription ( QStringLiteral ( " my output" ) );
3824
- alg7c1outputs.insert ( QStringLiteral ( " OUTPUT_LAYER " ), alg7c1out1 );
3824
+ alg7c1outputs.insert ( QStringLiteral ( " my_output " ), alg7c1out1 );
3825
3825
alg7c1.setModelOutputs ( alg7c1outputs );
3826
3826
alg7.addChildAlgorithm ( alg7c1 );
3827
3827
// verify that model has destination parameter created
3828
3828
QCOMPARE ( alg7.destinationParameterDefinitions ().count (), 1 );
3829
- QCOMPARE ( alg7.destinationParameterDefinitions ().at ( 0 )->name (), QStringLiteral ( " cx1:OUTPUT_LAYER " ) );
3829
+ QCOMPARE ( alg7.destinationParameterDefinitions ().at ( 0 )->name (), QStringLiteral ( " cx1:my_output " ) );
3830
3830
QCOMPARE ( alg7.destinationParameterDefinitions ().at ( 0 )->description (), QStringLiteral ( " my output" ) );
3831
3831
QCOMPARE ( alg7.outputDefinitions ().count (), 1 );
3832
- QCOMPARE ( alg7.outputDefinitions ().at ( 0 )->name (), QStringLiteral ( " cx1:OUTPUT_LAYER " ) );
3832
+ QCOMPARE ( alg7.outputDefinitions ().at ( 0 )->name (), QStringLiteral ( " cx1:my_output " ) );
3833
3833
QCOMPARE ( alg7.outputDefinitions ().at ( 0 )->type (), QStringLiteral ( " outputVector" ) );
3834
3834
QCOMPARE ( alg7.outputDefinitions ().at ( 0 )->description (), QStringLiteral ( " my output" ) );
3835
3835
3836
3836
QgsProcessingModelAlgorithm::ChildAlgorithm alg7c2;
3837
3837
alg7c2.setChildId ( " cx2" );
3838
3838
alg7c2.setAlgorithmId ( " native:centroids" );
3839
3839
QMap<QString, QgsProcessingModelAlgorithm::ModelOutput> alg7c2outputs;
3840
- QgsProcessingModelAlgorithm::ModelOutput alg7c2out1;
3840
+ QgsProcessingModelAlgorithm::ModelOutput alg7c2out1 ( QStringLiteral ( " my_output2 " ) ) ;
3841
3841
alg7c2out1.setChildId ( " cx2" );
3842
- alg7c2out1.setOutputName ( " OUTPUT_LAYER" );
3842
+ alg7c2out1.setChildOutputName ( " OUTPUT_LAYER" );
3843
3843
alg7c2out1.setDescription ( QStringLiteral ( " my output2" ) );
3844
- alg7c2outputs.insert ( QStringLiteral ( " OUTPUT_LAYER " ), alg7c2out1 );
3844
+ alg7c2outputs.insert ( QStringLiteral ( " my_output2 " ), alg7c2out1 );
3845
3845
alg7c2.setModelOutputs ( alg7c2outputs );
3846
3846
alg7.addChildAlgorithm ( alg7c2 );
3847
3847
3848
3848
QCOMPARE ( alg7.destinationParameterDefinitions ().count (), 2 );
3849
- QCOMPARE ( alg7.destinationParameterDefinitions ().at ( 0 )->name (), QStringLiteral ( " cx1:OUTPUT_LAYER " ) );
3849
+ QCOMPARE ( alg7.destinationParameterDefinitions ().at ( 0 )->name (), QStringLiteral ( " cx1:my_output " ) );
3850
3850
QCOMPARE ( alg7.destinationParameterDefinitions ().at ( 0 )->description (), QStringLiteral ( " my output" ) );
3851
- QCOMPARE ( alg7.destinationParameterDefinitions ().at ( 1 )->name (), QStringLiteral ( " cx2:OUTPUT_LAYER " ) );
3851
+ QCOMPARE ( alg7.destinationParameterDefinitions ().at ( 1 )->name (), QStringLiteral ( " cx2:my_output2 " ) );
3852
3852
QCOMPARE ( alg7.destinationParameterDefinitions ().at ( 1 )->description (), QStringLiteral ( " my output2" ) );
3853
3853
QCOMPARE ( alg7.outputDefinitions ().count (), 2 );
3854
- QCOMPARE ( alg7.outputDefinitions ().at ( 0 )->name (), QStringLiteral ( " cx1:OUTPUT_LAYER " ) );
3854
+ QCOMPARE ( alg7.outputDefinitions ().at ( 0 )->name (), QStringLiteral ( " cx1:my_output " ) );
3855
3855
QCOMPARE ( alg7.outputDefinitions ().at ( 0 )->type (), QStringLiteral ( " outputVector" ) );
3856
3856
QCOMPARE ( alg7.outputDefinitions ().at ( 0 )->description (), QStringLiteral ( " my output" ) );
3857
- QCOMPARE ( alg7.outputDefinitions ().at ( 1 )->name (), QStringLiteral ( " cx2:OUTPUT_LAYER " ) );
3857
+ QCOMPARE ( alg7.outputDefinitions ().at ( 1 )->name (), QStringLiteral ( " cx2:my_output2 " ) );
3858
3858
QCOMPARE ( alg7.outputDefinitions ().at ( 1 )->type (), QStringLiteral ( " outputVector" ) );
3859
3859
QCOMPARE ( alg7.outputDefinitions ().at ( 1 )->description (), QStringLiteral ( " my output2" ) );
3860
3860
3861
3861
alg7.removeChildAlgorithm ( " cx1" );
3862
3862
QCOMPARE ( alg7.destinationParameterDefinitions ().count (), 1 );
3863
- QCOMPARE ( alg7.destinationParameterDefinitions ().at ( 0 )->name (), QStringLiteral ( " cx2:OUTPUT_LAYER " ) );
3863
+ QCOMPARE ( alg7.destinationParameterDefinitions ().at ( 0 )->name (), QStringLiteral ( " cx2:my_output2 " ) );
3864
3864
QCOMPARE ( alg7.destinationParameterDefinitions ().at ( 0 )->description (), QStringLiteral ( " my output2" ) );
3865
3865
QCOMPARE ( alg7.outputDefinitions ().count (), 1 );
3866
- QCOMPARE ( alg7.outputDefinitions ().at ( 0 )->name (), QStringLiteral ( " cx2:OUTPUT_LAYER " ) );
3866
+ QCOMPARE ( alg7.outputDefinitions ().at ( 0 )->name (), QStringLiteral ( " cx2:my_output2 " ) );
3867
3867
QCOMPARE ( alg7.outputDefinitions ().at ( 0 )->type (), QStringLiteral ( " outputVector" ) );
3868
3868
QCOMPARE ( alg7.outputDefinitions ().at ( 0 )->description (), QStringLiteral ( " my output2" ) );
3869
3869
}
@@ -3908,7 +3908,8 @@ void TestQgsProcessing::modelExecution()
3908
3908
alg2c1.addParameterSource ( " JOIN_STYLE" , QgsProcessingModelAlgorithm::ChildParameterSource::fromStaticValue ( 2 ) );
3909
3909
alg2c1.addParameterSource ( " DISSOLVE" , QgsProcessingModelAlgorithm::ChildParameterSource::fromStaticValue ( false ) );
3910
3910
QMap<QString, QgsProcessingModelAlgorithm::ModelOutput> outputs1;
3911
- QgsProcessingModelAlgorithm::ModelOutput out1 ( " OUTPUT_LAYER" );
3911
+ QgsProcessingModelAlgorithm::ModelOutput out1 ( " MODEL_OUT_LAYER" );
3912
+ out1.setChildOutputName ( " OUTPUT_LAYER" );
3912
3913
outputs1.insert ( QStringLiteral ( " MODEL_OUT_LAYER" ), out1 );
3913
3914
alg2c1.setModelOutputs ( outputs1 );
3914
3915
model2.addChildAlgorithm ( alg2c1 );
0 commit comments