Skip to content

Commit

Permalink
Be more QML friendly (#32652)
Browse files Browse the repository at this point in the history
* add Q_ENUM for QgsGeometry::OperationResult

* QgsVectorLayer::startEditing, commitChanges and editBuffer Q_INVOKABLE

* Fix indentation

* fix sip
  • Loading branch information
3nids committed Nov 6, 2019
1 parent 1c1ceb1 commit 5910a7b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions python/core/auto_additions/qgsgeometry.py
@@ -1,4 +1,5 @@
# The following has been generated automatically from src/core/geometry/qgsgeometry.h
QgsGeometry.OperationResult.baseClass = QgsGeometry
QgsGeometry.BufferSide.baseClass = QgsGeometry
QgsGeometry.EndCapStyle.baseClass = QgsGeometry
QgsGeometry.JoinStyle.baseClass = QgsGeometry
1 change: 1 addition & 0 deletions src/core/geometry/qgsgeometry.h
Expand Up @@ -152,6 +152,7 @@ class CORE_EXPORT QgsGeometry
/* Split features */
SplitCannotSplitPoint, //!< Cannot split points
};
Q_ENUM( OperationResult )

//! Constructor
QgsGeometry();
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsvectorlayer.h
Expand Up @@ -1843,7 +1843,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* \see commitErrors()
* \see rollBack()
*/
bool commitChanges();
Q_INVOKABLE bool commitChanges();

/**
* Returns a list containing any error messages generated when attempting
Expand Down Expand Up @@ -1872,7 +1872,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
QList<QgsRelation> referencingRelations( int idx ) const;

//! Buffer with uncommitted editing operations. Only valid after editing has been turned on.
QgsVectorLayerEditBuffer *editBuffer() { return mEditBuffer; }
Q_INVOKABLE QgsVectorLayerEditBuffer *editBuffer() { return mEditBuffer; }

/**
* Buffer with uncommitted editing operations. Only valid after editing has been turned on.
Expand Down Expand Up @@ -2365,7 +2365,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* \see commitChanges()
* \see rollBack()
*/
bool startEditing();
Q_INVOKABLE bool startEditing();

/**
* Sets the coordinate transform context to \a transformContext
Expand Down

0 comments on commit 5910a7b

Please sign in to comment.