File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -530,7 +530,8 @@ void QgsAttributeForm::initPython()
530
530
QString numArgs;
531
531
QgsPythonRunner::eval ( QString ( " len(inspect.getargspec(%1)[0])" ).arg ( module ), numArgs );
532
532
533
- mPyFormVarName = QString ( " _qgis_featureform_%1" ).arg ( mFormNr );
533
+ static int sFormId = 0 ;
534
+ mPyFormVarName = QString ( " _qgis_featureform_%1_%2" ).arg ( mFormNr ).arg ( sFormId ++ );
534
535
535
536
QString form = QString ( " %1 = sip.wrapinstance( %2, qgis.gui.QgsAttributeForm )" )
536
537
.arg ( mPyFormVarName )
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ QgsAttributeFormLegacyInterface::QgsAttributeFormLegacyInterface( const QString&
27
27
, mPyFunctionName( function )
28
28
, mPyFormVarName( pyFormName )
29
29
{
30
- mPyLayerVarName = QString ( " _qgis_layer_%1" ).arg ( form->layer ()->id () );
30
+ static int sLayerCounter = 0 ;
31
+ mPyLayerVarName = QString ( " _qgis_layer_%1_%2" ).arg ( form->layer ()->id () ).arg ( sLayerCounter ++ );
31
32
mPyLayerVarName .replace ( QRegExp ( " [^a-zA-Z0-9_]" ), " _" ); // clean identifier
32
33
33
34
QString initLayer = QString ( " %1 = sip.wrapinstance( %2, qgis.core.QgsVectorLayer )" )
You can’t perform that action at this time.
0 commit comments