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 56acda645822a631a4a3952e2a79ad64bc449fef
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/gui/qgsattributeformlegacyinterface.cpp
@@ -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.
You can’t perform that action at this time.