Skip to content

Commit

Permalink
Avoid hidding attribute linked to parent feature in relation, just di…
Browse files Browse the repository at this point in the history
…sable
  • Loading branch information
nirvn committed Feb 4, 2023
1 parent c1b354f commit 214eee7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/attributeformmodelbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,11 @@ void AttributeFormModelBase::updateAttributeValue( QStandardItem *item )
QVariant attributeValue = mFeatureModel->data( mFeatureModel->index( fieldIndex ), FeatureModel::AttributeValue );
item->setData( attributeValue.isNull() ? QVariant() : attributeValue, AttributeFormModel::AttributeValue );
item->setData( mFeatureModel->data( mFeatureModel->index( fieldIndex ), FeatureModel::AttributeAllowEdit ), AttributeFormModel::AttributeAllowEdit );
//set item visibility to false in case it's a linked attribute
item->setData( !mFeatureModel->data( mFeatureModel->index( fieldIndex ), FeatureModel::LinkedAttribute ).toBool(), AttributeFormModel::CurrentlyVisible );
// set item editable state to false in case it's a linked attribute
if ( mFeatureModel->data( mFeatureModel->index( fieldIndex ), FeatureModel::LinkedAttribute ).toBool() )
{
item->setData( false, AttributeFormModel::AttributeEditable );
}
}
else if ( item->data( AttributeFormModel::ElementType ) == QStringLiteral( "qml" ) || item->data( AttributeFormModel::ElementType ) == QStringLiteral( "html" ) )
{
Expand Down

0 comments on commit 214eee7

Please sign in to comment.