[Qgis-developer] PyQGIS: how to set "Enable snapping on intersection" option?

Gino Pirelli luipir at gmail.com
Fri Mar 21 02:04:36 PDT 2014

checking the code I can find that ticking "Enable snapping on intersection"
checkbox activate this callback

void QgsSnappingDialog::on_cbxEnableIntersectionSnappingCheckBox_stateChanged(
int state )


  QgsProject::instance()->writeEntry( "Digitizing",
"/IntersectionSnapping", state == Qt::Checked );


writing the option in the project...

there's is a reason why it is not set in QSettings

Luigi Pirelli (luigi.pirelli at faunalia.it - luipir at gmail.com)

On 20 March 2014 20:46, Gino Pirelli <luipir at gmail.com> wrote:

> Hi,
> I'm looking how to programmatically set on or off the snapping option:
> "Enable snapping on intersection"
> I can't find how! It seems not set in QGIS2.conf
> without setting this option the QgsSnapper.snapToBackgroundLayers(...)
> method doesn't return snap points.
> thank you,
> Luigi Pirelli (luigi.pirelli at faunalia.it - luipir at gmail.com)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140321/482fce78/attachment.html>

More information about the Qgis-developer mailing list