Skip to content
Permalink
Browse files

Add readOnly property to QgsVectorLayer

  • Loading branch information
m-kuhn committed Aug 19, 2016
1 parent 1fda77c commit 11c626d8e17bdb248d023e00428c4daa5bd6fa86
Showing with 21 additions and 0 deletions.
  1. +8 −0 python/core/qgsvectorlayer.sip
  2. +1 −0 src/core/qgsvectorlayer.cpp
  3. +12 −0 src/core/qgsvectorlayer.h
@@ -1641,6 +1641,14 @@ class QgsVectorLayer : QgsMapLayer
* @Note added in QGIS 3.0
*/
void editFormConfigChanged();

/**
* Emitted when the read only state of this layer is changed.
* Only applies to manually set readonly state, not to the edit mode.
*
* @note Added in QGIS 3.0
*/
void readOnlyChanged();
protected:
/** Set the extent */
void setExtent( const QgsRectangle &rect );
@@ -2615,6 +2615,7 @@ bool QgsVectorLayer::setReadOnly( bool readonly )
return false;

mReadOnly = readonly;
emit readOnlyChanged();
return true;
}

@@ -413,6 +413,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
Q_PROPERTY( QString displayExpression READ displayExpression WRITE setDisplayExpression NOTIFY displayExpressionChanged )
Q_PROPERTY( QString mapTipTemplate READ mapTipTemplate WRITE setMapTipTemplate NOTIFY mapTipTemplateChanged )
Q_PROPERTY( QgsEditFormConfig editFormConfig READ editFormConfig WRITE setEditFormConfig NOTIFY editFormConfigChanged )
Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly NOTIFY readOnlyChanged )

public:

@@ -1765,9 +1766,20 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte

/**
* Will be emitted whenever the edit form configuration of this layer changes.
*
* @note added in QGIS 3.0
*/
void editFormConfigChanged();

/**
* Emitted when the read only state of this layer is changed.
* Only applies to manually set readonly state, not to the edit mode.
*
* @note Added in QGIS 3.0
*/
void readOnlyChanged();


private slots:
void onJoinedFieldsChanged();
void onFeatureDeleted( QgsFeatureId fid );

0 comments on commit 11c626d

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