Skip to content

Commit

Permalink
[relations] Show polymorphic relation name in config dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn authored and nyalldawson committed Dec 11, 2024
1 parent d2643f6 commit d96020b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/gui/vector/qgsattributesformproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,17 @@ void QgsAttributesFormProperties::initAvailableWidgetsTree()

for ( const QgsRelation &relation : relations )
{
DnDTreeItemData itemData = DnDTreeItemData( DnDTreeItemData::Relation, relation.id(), relation.name() );
QString name;
const QgsPolymorphicRelation polymorphicRelation = relation.polymorphicRelation();
if( polymorphicRelation.isValid() )
{
name = QStringLiteral( "%1 (%2)" ).arg( relation.name(), polymorphicRelation.name() );
}
else
{
name = relation.name();
}
DnDTreeItemData itemData = DnDTreeItemData( DnDTreeItemData::Relation, relation.id(), name );
itemData.setShowLabel( true );
QTreeWidgetItem *item = mAvailableWidgetsTree->addItem( catitem, itemData );
item->setData( 0, FieldNameRole, relation.id() );
Expand Down

0 comments on commit d96020b

Please sign in to comment.