Skip to content

Commit 99d82c2

Browse files
committed
Keep the return value of Python init function alive while form open
1 parent 04068c9 commit 99d82c2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/gui/qgsattributedialog.cpp‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,13 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
423423
QgsPythonRunner::run( feature );
424424
QgsPythonRunner::run( layer );
425425

426-
QString expr = QString( "%1(_qgis_featureform_%2, _qgis_layer_%3, %4)" )
426+
QString returnvarname = QString( "_qgis_feature_form_%1" ).arg( dt.toString( "yyyyMMddhhmmsszzz" ) );
427+
QString expr = QString( "%5 = %1(_qgis_featureform_%2, _qgis_layer_%3, %4)" )
427428
.arg( vl->editFormInit() )
428429
.arg( mFormNr )
429430
.arg( vl->id() )
430-
.arg( featurevarname );
431+
.arg( featurevarname )
432+
.arg( returnvarname );
431433

432434
QgsDebugMsg( QString( "running featureForm init: %1" ).arg( expr ) );
433435
QgsPythonRunner::run( expr );

0 commit comments

Comments
 (0)