Skip to content
Permalink
Browse files

Fix code sample formatting

  • Loading branch information
DelazJ authored and nyalldawson committed Jul 3, 2020
1 parent f7f9534 commit 0876baece30b75794aa9406f95e83337ac72b7c1
Showing with 16 additions and 16 deletions.
  1. +6 −6 python/core/auto_generated/qgssnappingutils.sip.in
  2. +10 −10 src/core/qgssnappingutils.h
@@ -118,14 +118,14 @@ Find out which strategy is used for indexing - by default hybrid indexing is use
%Docstring
Create a new configuration for a snapping layer.

```py
snapper = QgsMapCanvasSnappingUtils(mapCanvas)
.. code-block:: python

snapping_layer1 = QgsSnappingUtils.LayerConfig(layer1, QgsPointLocator.Vertex, 10, QgsTolerance.Pixels)
snapping_layer2 = QgsSnappingUtils.LayerConfig(layer2, QgsPointLocator.Vertex and QgsPointLocator.Edge, 10, QgsTolerance.Pixels)
snapper = QgsMapCanvasSnappingUtils(mapCanvas)

snapper.setLayers([snapping_layer1, snapping_layer2])
```
snapping_layer1 = QgsSnappingUtils.LayerConfig(layer1, QgsPointLocator.Vertex, 10, QgsTolerance.Pixels)
snapping_layer2 = QgsSnappingUtils.LayerConfig(layer2, QgsPointLocator.Vertex and QgsPointLocator.Edge, 10, QgsTolerance.Pixels)

snapper.setLayers([snapping_layer1, snapping_layer2])

:param l: The vector layer for which this configuration is
:param t: Which parts of the geometry should be snappable
@@ -123,16 +123,16 @@ class CORE_EXPORT QgsSnappingUtils : public QObject

/**
* Create a new configuration for a snapping layer.
```py
snapper = QgsMapCanvasSnappingUtils(mapCanvas)
snapping_layer1 = QgsSnappingUtils.LayerConfig(layer1, QgsPointLocator.Vertex, 10, QgsTolerance.Pixels)
snapping_layer2 = QgsSnappingUtils.LayerConfig(layer2, QgsPointLocator.Vertex and QgsPointLocator.Edge, 10, QgsTolerance.Pixels)
snapper.setLayers([snapping_layer1, snapping_layer2])
```
*
* \code{.py}
* snapper = QgsMapCanvasSnappingUtils(mapCanvas)
*
* snapping_layer1 = QgsSnappingUtils.LayerConfig(layer1, QgsPointLocator.Vertex, 10, QgsTolerance.Pixels)
* snapping_layer2 = QgsSnappingUtils.LayerConfig(layer2, QgsPointLocator.Vertex and QgsPointLocator.Edge, 10, QgsTolerance.Pixels)
*
* snapper.setLayers([snapping_layer1, snapping_layer2])
* \endcode
*
* \param l The vector layer for which this configuration is
* \param t Which parts of the geometry should be snappable
* \param tol The tolerance radius in which the snapping will trigger

0 comments on commit 0876bae

Please sign in to comment.
You can’t perform that action at this time.