Skip to content
Permalink
Browse files

Send signals when geometry options change

  • Loading branch information
m-kuhn committed Oct 1, 2018
1 parent 859ac16 commit f82970d79a4b3204d7058184064816ef6e8ef2ff
@@ -9,7 +9,8 @@



class QgsGeometryOptions

class QgsGeometryOptions : QObject
{
%Docstring

@@ -114,6 +115,38 @@ Write the geometry options to the ``node``.
%Docstring
Read the geometry options from ``node``.

.. versionadded:: 3.4
%End

signals:

void checkConfigurationChanged();
%Docstring
Access the configuration for the check ``checkId``.

.. versionadded:: 3.4
%End

void geometryChecksChanged();
%Docstring
A list of activated geometry checks.

.. versionadded:: 3.4
%End

void removeDuplicateNodesChanged();
%Docstring
Automatically remove duplicate nodes on all geometries which are edited on this layer.

.. versionadded:: 3.4
%End

void geometryPrecisionChanged();
%Docstring
The precision in which geometries on this layer should be saved.
Geometries which are edited on this layer will be rounded to multiples of this value (snap to grid).
Set to 0.0 to disable.

.. versionadded:: 3.4
%End

@@ -606,6 +606,7 @@ SET(QGIS_CORE_MOC_HDRS
qgsfiledownloader.h
qgsfeaturefiltermodel.h
qgsfeaturefiltermodel_p.h
qgsgeometryoptions.h
qgsgeometryvalidator.h
qgsgml.h
qgsgmlschema.h
@@ -869,7 +870,6 @@ SET(QGIS_CORE_HDRS
qgsfields.h
qgsfileutils.h
qgsfontutils.h
qgsgeometryoptions.h
qgsgeometrysimplifier.h
qgshistogram.h
qgshstoreutils.h
@@ -27,6 +27,7 @@ bool QgsGeometryOptions::removeDuplicateNodes() const
void QgsGeometryOptions::setRemoveDuplicateNodes( bool value )
{
mRemoveDuplicateNodes = value;
emit removeDuplicateNodesChanged();
}

double QgsGeometryOptions::geometryPrecision() const
@@ -37,6 +38,7 @@ double QgsGeometryOptions::geometryPrecision() const
void QgsGeometryOptions::setGeometryPrecision( double value )
{
mGeometryPrecision = value;
emit geometryPrecisionChanged();
}

bool QgsGeometryOptions::isActive() const
@@ -61,6 +63,7 @@ QStringList QgsGeometryOptions::geometryChecks() const
void QgsGeometryOptions::setGeometryChecks( const QStringList &geometryChecks )
{
mGeometryChecks = geometryChecks;
emit geometryChecksChanged();
}

QVariantMap QgsGeometryOptions::checkConfiguration( const QString &checkId ) const
@@ -71,6 +74,7 @@ QVariantMap QgsGeometryOptions::checkConfiguration( const QString &checkId ) con
void QgsGeometryOptions::setCheckConfiguration( const QString &checkId, const QVariantMap &checkConfiguration )
{
mCheckConfiguration[checkId] = checkConfiguration;
emit checkConfigurationChanged();
}

void QgsGeometryOptions::writeXml( QDomNode &node ) const
@@ -22,6 +22,8 @@
#include "qgis_sip.h"
#include "qgsgeometry.h"

#include <QObject>

/**
* \ingroup core
*
@@ -30,8 +32,10 @@
*
* \since QGIS 3.4
*/
class CORE_EXPORT QgsGeometryOptions
class CORE_EXPORT QgsGeometryOptions : public QObject
{
Q_OBJECT

public:

/**
@@ -127,6 +131,38 @@ class CORE_EXPORT QgsGeometryOptions
*/
void readXml( const QDomNode &node );

signals:

/**
* Access the configuration for the check \a checkId.
*
* \since QGIS 3.4
*/
void checkConfigurationChanged();

/**
* A list of activated geometry checks.
*
* \since QGIS 3.4
*/
void geometryChecksChanged();

/**
* Automatically remove duplicate nodes on all geometries which are edited on this layer.
*
* \since QGIS 3.4
*/
void removeDuplicateNodesChanged();

/**
* The precision in which geometries on this layer should be saved.
* Geometries which are edited on this layer will be rounded to multiples of this value (snap to grid).
* Set to 0.0 to disable.
*
* \since QGIS 3.4
*/
void geometryPrecisionChanged();

private:

/**

0 comments on commit f82970d

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