mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Add readOnly property to QgsVectorLayer
This commit is contained in:
parent
1fda77c798
commit
11c626d8e1
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user