Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Keep the return value of Python init function alive while form open
  • Loading branch information
NathanW2 committed Jul 26, 2013
1 parent 04068c9 commit 99d82c2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/qgsattributedialog.cpp
Expand Up @@ -423,11 +423,13 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
QgsPythonRunner::run( feature );
QgsPythonRunner::run( layer );

QString expr = QString( "%1(_qgis_featureform_%2, _qgis_layer_%3, %4)" )
QString returnvarname = QString( "_qgis_feature_form_%1" ).arg( dt.toString( "yyyyMMddhhmmsszzz" ) );
QString expr = QString( "%5 = %1(_qgis_featureform_%2, _qgis_layer_%3, %4)" )
.arg( vl->editFormInit() )
.arg( mFormNr )
.arg( vl->id() )
.arg( featurevarname );
.arg( featurevarname )
.arg( returnvarname );

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

0 comments on commit 99d82c2

Please sign in to comment.