Skip to content

Commit 2b033c1

Browse files
committed
Fix relation manager mess when adding new relations
The table showed wrong information because it didn't take sorting into account and relied on stable row numbers.
1 parent 17510f0 commit 2b033c1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/app/qgsrelationmanagerdialog.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ void QgsRelationManagerDialog::setLayers( const QList< QgsVectorLayer* >& layers
4646

4747
void QgsRelationManagerDialog::addRelation( const QgsRelation &rel )
4848
{
49+
mRelationsTable->setSortingEnabled( false );
4950
int row = mRelationsTable->rowCount();
5051
mRelationsTable->insertRow( row );
5152

@@ -74,6 +75,7 @@ void QgsRelationManagerDialog::addRelation( const QgsRelation &rel )
7475
item = new QTableWidgetItem( rel.id() );
7576
item->setFlags( Qt::ItemIsEditable );
7677
mRelationsTable->setItem( row, 5, item );
78+
mRelationsTable->setSortingEnabled( true );
7779
}
7880

7981
void QgsRelationManagerDialog::on_mBtnAddRelation_clicked()

0 commit comments

Comments
 (0)