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

2014-03-21 Thread Gino Pirelli
I solved adding the same peace of code of the C++ apply method in my case the code is project = QgsProject.instance() layerSnappingList = [layer1Id, later2Id] layerSnappingEnabledList = ["enabled", "enabled"] layerSnappingToleranceUnitList = ["0", "0"] laye

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

2014-03-21 Thread Gino Pirelli
thanks Jacob seems it works setting all QgsProject parameters as in: void QgsSnappingDialog::apply() My doubt is that probably should be useful to add a default option on snapping/digitinzing as "snap on intersection background" getting all layer in background by default. I'll try to propose

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

2014-03-21 Thread Jakob Lanstorp
Looks like this setting is not exposed in the API of QgsSnapper or QSettings: http://qgis.org/api/2.2/classQgsSnapper.html#addd2b16ecac193e56f7bdedd6b78ac59 and from PyQt4.QtCore import QSettings print QSettings(

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

2014-03-21 Thread Gino Pirelli
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::Check

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

2014-03-20 Thread Gino Pirelli
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 (lui