Skip to content
Permalink
Browse files
Don't show edit pencil in layer tree for editable layers which do not
allow the user to toggle editing
  • Loading branch information
nyalldawson committed Sep 6, 2021
1 parent 13b6cbc commit 7b11b5343aca4eb83ebdf11114e900b78c03a672
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/layertree/qgslayertreemodel.cpp
@@ -207,7 +207,7 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
icon = legendIconEmbeddedInParent( nodeLayer );
}

if ( !icon.isNull() && layer->isEditable() && testFlag( UseTextFormatting ) )
if ( !icon.isNull() && layer->isEditable() && !( layer->properties() & Qgis::MapLayerProperty::UsersCannotToggleEditing ) && testFlag( UseTextFormatting ) )
{
const int iconSize = scaleIconSize( 16 );
QPixmap pixmap( icon.pixmap( iconSize, iconSize ) );

0 comments on commit 7b11b53

Please sign in to comment.