16 #ifndef QGSPROJECTSNAPPINGSETTINGS_H 17 #define QGSPROJECTSNAPPINGSETTINGS_H 21 #include "qgis_core.h" 38 Q_PROPERTY(
QgsProject *project READ project WRITE setProject )
49 AdvancedConfiguration = 3,
85 IndividualLayerSettings() =
default;
94 void setEnabled(
bool enabled );
103 double tolerance()
const;
106 void setTolerance(
double tolerance );
123 bool mEnabled =
false;
125 double mTolerance = 0;
140 bool enabled()
const;
143 void setEnabled(
bool enabled );
158 double tolerance()
const;
161 void setTolerance(
double tolerance );
170 bool intersectionSnapping()
const;
173 void setIntersectionSnapping(
bool enabled );
177 QHash<QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings> individualLayerSettings()
const;
179 SIP_PYDICT individualLayerSettings()
const;
182 PyObject *d = PyDict_New();
186 QHash<QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings> container = sipCpp->individualLayerSettings();
187 QHash<QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings>::const_iterator i = container.constBegin();
188 while ( i != container.constEnd() )
193 PyObject *vlobj = sipConvertFromType( vl, sipType_QgsVectorLayer,
nullptr );
194 PyObject *ilsobj = sipConvertFromType( ils, sipType_QgsSnappingConfig_IndividualLayerSettings, Py_None );
196 if ( !vlobj || !ilsobj || PyDict_SetItem( d, vlobj, ilsobj ) < 0 )
211 PyErr_SetString( PyExc_StopIteration,
"" );
237 void readProject(
const QDomDocument &doc );
244 void writeProject( QDomDocument &doc );
256 bool addLayers(
const QList<QgsMapLayer *> &layers );
268 bool removeLayers(
const QList<QgsMapLayer *> &layers );
285 void readLegacySettings();
289 bool mEnabled =
false;
292 double mTolerance = 0.0;
294 bool mIntersectionSnapping =
false;
296 QHash<QgsVectorLayer *, IndividualLayerSettings> mIndividualLayerSettings;
300 #endif // QGSPROJECTSNAPPINGSETTINGS_H SnappingMode
SnappingMode defines on which layer the snapping is performed.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
UnitType
Type of unit of tolerance value from settings.
Pixels unit of tolerance.
Reads and writes project states.
This is a container of advanced configuration (per layer) of the snapping of the project.
SnappingType
SnappingType defines on what object the snapping is performed.
Map (project) units. Added in 2.8.
This is a container for configuration of the snapping of the project.
Represents a vector layer which manages a vector based data sets.