40 Q_PROPERTY(
QgsProject *project READ project WRITE setProject )
41 Q_PROPERTY(
bool enabled READ enabled WRITE setEnabled )
42 Q_PROPERTY(
Qgis::SnappingMode mode READ mode WRITE setMode )
70 Q_ENUM( ScaleDependencyMode )
142 bool enabled()
const;
145 void setEnabled(
bool enabled );
169 void setTypeFlag(
Qgis::SnappingTypes type );
172 double tolerance() const;
175 void setTolerance(
double tolerance );
178 Qgis::MapToolUnit units() const;
181 void setUnits(
Qgis::MapToolUnit units );
187 double minimumScale() const;
193 void setMinimumScale(
double minScale );
199 double maximumScale() const;
205 void setMaximumScale(
double maxScale );
214 bool mEnabled = false;
216 double mTolerance = 0;
217 Qgis::MapToolUnit mUnits =
Qgis::MapToolUnit::Pixels;
218 double mMinimumScale = 0.0;
219 double mMaximumScale = 0.0;
233 bool enabled() const;
236 void setEnabled(
bool enabled );
239 Qgis::SnappingMode mode() const;
242 void setMode(
Qgis::SnappingMode mode );
248 Qgis::SnappingTypes typeFlag() const;
266 void setTypeFlag(
Qgis::SnappingTypes type );
269 double tolerance() const;
272 void setTolerance(
double tolerance );
278 double minimumScale() const;
284 void setMinimumScale(
double minScale );
290 double maximumScale() const;
296 void setMaximumScale(
double maxScale );
311 Qgis::MapToolUnit units() const;
314 void setUnits(
Qgis::MapToolUnit units );
317 bool intersectionSnapping() const;
320 void setIntersectionSnapping(
bool enabled );
327 bool selfSnapping() const;
334 void setSelfSnapping(
bool enabled );
338 QHash<QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings> individualLayerSettings()
const;
340 SIP_PYDICT individualLayerSettings()
const;
343 PyObject *d = PyDict_New();
347 QHash<QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings> container = sipCpp->individualLayerSettings();
348 QHash<QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings>::const_iterator i = container.constBegin();
349 while ( i != container.constEnd() )
354 PyObject *vlobj = sipConvertFromType( vl, sipType_QgsVectorLayer,
nullptr );
355 PyObject *ilsobj = sipConvertFromType( ils, sipType_QgsSnappingConfig_IndividualLayerSettings, Py_None );
357 if ( !vlobj || !ilsobj || PyDict_SetItem( d, vlobj, ilsobj ) < 0 )
372 PyErr_SetString( PyExc_StopIteration,
"" );
393 void clearIndividualLayerSettings();
401 void readProject(
const QDomDocument &doc );
407 void writeProject( QDomDocument &doc );
418 bool addLayers(
const QList<QgsMapLayer *> &layers );
429 bool removeLayers(
const QList<QgsMapLayer *> &layers );
444 void readLegacySettings();
448 bool mEnabled =
false;
451 double mTolerance = 0.0;
452 ScaleDependencyMode mScaleDependencyMode = Disabled;
453 double mMinimumScale = 0.0;
454 double mMaximumScale = 0.0;
456 bool mIntersectionSnapping =
false;
457 bool mSelfSnapping =
false;
459 QHash<QgsVectorLayer *, IndividualLayerSettings> mIndividualLayerSettings;