41 Q_PROPERTY(
QgsProject *project READ project WRITE setProject )
42 Q_PROPERTY(
bool enabled READ enabled WRITE setEnabled )
43 Q_PROPERTY(
Qgis::SnappingMode mode READ mode WRITE setMode )
71 Q_ENUM( ScaleDependencyMode )
144 bool enabled()
const;
147 void setEnabled(
bool enabled );
153 Qgis::SnappingTypes typeFlag()
const;
171 void setTypeFlag(
Qgis::SnappingTypes type );
174 double tolerance() const;
177 void setTolerance(
double tolerance );
180 Qgis::MapToolUnit units() const;
183 void setUnits(
Qgis::MapToolUnit units );
189 double minimumScale() const;
195 void setMinimumScale(
double minScale );
201 double maximumScale() const;
207 void setMaximumScale(
double maxScale );
219 bool mEnabled = false;
221 double mTolerance = 0;
222 Qgis::MapToolUnit mUnits =
Qgis::MapToolUnit::Pixels;
223 double mMinimumScale = 0.0;
224 double mMaximumScale = 0.0;
238 bool enabled() const;
241 void setEnabled(
bool enabled );
244 Qgis::SnappingMode mode() const;
247 void setMode(
Qgis::SnappingMode mode );
253 Qgis::SnappingTypes typeFlag() const;
271 void setTypeFlag(
Qgis::SnappingTypes type );
274 double tolerance() const;
277 void setTolerance(
double tolerance );
283 double minimumScale() const;
289 void setMinimumScale(
double minScale );
295 double maximumScale() const;
301 void setMaximumScale(
double maxScale );
316 Qgis::MapToolUnit units() const;
319 void setUnits(
Qgis::MapToolUnit units );
322 bool intersectionSnapping() const;
325 void setIntersectionSnapping(
bool enabled );
332 bool selfSnapping() const;
339 void setSelfSnapping(
bool enabled );
343 QHash<QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings> individualLayerSettings()
const;
345 SIP_PYDICT individualLayerSettings()
const;
348 PyObject *d = PyDict_New();
352 QHash<QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings> container = sipCpp->individualLayerSettings();
353 QHash<QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings>::const_iterator i = container.constBegin();
354 while ( i != container.constEnd() )
359 PyObject *vlobj = sipConvertFromType( vl, sipType_QgsVectorLayer,
nullptr );
360 PyObject *ilsobj = sipConvertFromType( ils, sipType_QgsSnappingConfig_IndividualLayerSettings, Py_None );
362 if ( !vlobj || !ilsobj || PyDict_SetItem( d, vlobj, ilsobj ) < 0 )
377 PyErr_SetString( PyExc_StopIteration,
"" );
398 void clearIndividualLayerSettings();
410 void readProject(
const QDomDocument &doc );
417 void writeProject( QDomDocument &doc );
429 bool addLayers(
const QList<QgsMapLayer *> &layers );
441 bool removeLayers(
const QList<QgsMapLayer *> &layers );
458 void readLegacySettings();
462 bool mEnabled =
false;
465 double mTolerance = 0.0;
466 ScaleDependencyMode mScaleDependencyMode = Disabled;
467 double mMinimumScale = 0.0;
468 double mMaximumScale = 0.0;
470 bool mIntersectionSnapping =
false;
471 bool mSelfSnapping =
false;
473 QHash<QgsVectorLayer *, IndividualLayerSettings> mIndividualLayerSettings;