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 );
151 Qgis::SnappingTypes typeFlag()
const;
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 );
217 bool mEnabled = false;
219 double mTolerance = 0;
220 Qgis::MapToolUnit mUnits =
Qgis::MapToolUnit::Pixels;
221 double mMinimumScale = 0.0;
222 double mMaximumScale = 0.0;
236 bool enabled() const;
239 void setEnabled(
bool enabled );
242 Qgis::SnappingMode mode() const;
245 void setMode(
Qgis::SnappingMode mode );
251 Qgis::SnappingTypes typeFlag() const;
269 void setTypeFlag(
Qgis::SnappingTypes type );
272 double tolerance() const;
275 void setTolerance(
double tolerance );
281 double minimumScale() const;
287 void setMinimumScale(
double minScale );
293 double maximumScale() const;
299 void setMaximumScale(
double maxScale );
314 Qgis::MapToolUnit units() const;
317 void setUnits(
Qgis::MapToolUnit units );
320 bool intersectionSnapping() const;
323 void setIntersectionSnapping(
bool enabled );
330 bool selfSnapping() const;
337 void setSelfSnapping(
bool enabled );
341 QHash<QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings> individualLayerSettings()
const;
343 SIP_PYDICT individualLayerSettings()
const;
346 PyObject *d = PyDict_New();
350 QHash<QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings> container = sipCpp->individualLayerSettings();
351 QHash<QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings>::const_iterator i = container.constBegin();
352 while ( i != container.constEnd() )
357 PyObject *vlobj = sipConvertFromType( vl, sipType_QgsVectorLayer,
nullptr );
358 PyObject *ilsobj = sipConvertFromType( ils, sipType_QgsSnappingConfig_IndividualLayerSettings, Py_None );
360 if ( !vlobj || !ilsobj || PyDict_SetItem( d, vlobj, ilsobj ) < 0 )
375 PyErr_SetString( PyExc_StopIteration,
"" );
396 void clearIndividualLayerSettings();
407 void readProject(
const QDomDocument &doc );
413 void writeProject( QDomDocument &doc );
424 bool addLayers(
const QList<QgsMapLayer *> &layers );
435 bool removeLayers(
const QList<QgsMapLayer *> &layers );
450 void readLegacySettings();
454 bool mEnabled =
false;
457 double mTolerance = 0.0;
458 ScaleDependencyMode mScaleDependencyMode = Disabled;
459 double mMinimumScale = 0.0;
460 double mMaximumScale = 0.0;
462 bool mIntersectionSnapping =
false;
463 bool mSelfSnapping =
false;
465 QHash<QgsVectorLayer *, IndividualLayerSettings> mIndividualLayerSettings;