Skip to content

Commit 67b9c48

Browse files
committed
Reload form module if DEBUGMODE switch set in module
1 parent 50c3303 commit 67b9c48

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/gui/qgsattributedialog.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,14 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
346346
QgsPythonRunner::run( QString( "import %1" ).arg( module.left( pos ) ) );
347347
}
348348

349+
/* Reload the module if the DEBUGMODE switch has been set in the module.
350+
If set to False you have to reload QGIS to reset it to True due to Python
351+
module caching */
352+
QString reload = QString("if hasattr(%1,'DEBUGMODE') and %1.DEBUGMODE:"
353+
" reload(%1)").arg( module.left( pos ) );
354+
355+
QgsPythonRunner::run( reload );
356+
349357
mFormNr = smFormCounter++;
350358

351359
QString form = QString( "_qgis_featureform_%1 = wrapinstance( %2, QtGui.QDialog )" )

0 commit comments

Comments
 (0)