Skip to content

Commit

Permalink
Use the relation type
Browse files Browse the repository at this point in the history
  • Loading branch information
suricactus committed Jan 18, 2021
1 parent 17deefe commit fee7571
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/app/qgsrelationmanagerdialog.cpp
Expand Up @@ -164,18 +164,18 @@ bool QgsRelationManagerDialog::addRelationPrivate( const QgsRelation &rel, QTree
mRelationsTree->setSortingEnabled( false );
QTreeWidgetItem *item = new QTreeWidgetItem();

if ( parentItem )
switch ( rel.type() )
{
item->setFlags( item->flags() & ~Qt::ItemIsSelectable );
case QgsRelation::Normal:
item->setFlags( item->flags() | Qt::ItemIsEditable );
mRelationsTree->invisibleRootItem()->addChild( item );
break;
case QgsRelation::Generated:
Q_ASSERT( parentItem );
item->setFlags( item->flags() & ~Qt::ItemIsSelectable );
parentItem->addChild( item );
break;
}
else
{
Q_ASSERT( rel.type() != QgsRelation::Generated );
item->setFlags( item->flags() | Qt::ItemIsEditable );
parentItem = mRelationsTree->invisibleRootItem();
}

parentItem->addChild( item );

// Save relation in first column's item
item->setData( 0, Qt::UserRole, QVariant::fromValue<QgsRelation>( rel ) );
Expand Down

0 comments on commit fee7571

Please sign in to comment.