Skip to content
Permalink
Browse files
clean identifier of layer variable passed to the feature form
  • Loading branch information
jef-n committed Jul 24, 2014
1 parent 62e59c8 commit 56acda6
Showing 1 changed file with 2 additions and 0 deletions.
@@ -20,13 +20,15 @@

#include <QString>
#include <QDateTime>
#include <QRegExp>

QgsAttributeFormLegacyInterface::QgsAttributeFormLegacyInterface( const QString& function, const QString& pyFormName, QgsAttributeForm* form )
: QgsAttributeFormInterface( form )
, mPyFunctionName( function )
, mPyFormVarName( pyFormName )
{
mPyLayerVarName = QString( "_qgis_layer_%1" ).arg( form->layer()->id() );
mPyLayerVarName.replace( QRegExp( "[^a-zA-Z0-9_]" ), "_" ); // clean identifier

QString initLayer = QString( "%1 = sip.wrapinstance( %2, qgis.core.QgsVectorLayer )" )
.arg( mPyLayerVarName )

0 comments on commit 56acda6

Please sign in to comment.