Skip to content

Commit

Permalink
Fix crash on value relation multi-column
Browse files Browse the repository at this point in the history
Fix #54164
  • Loading branch information
elpaso authored and nyalldawson committed Oct 10, 2023
1 parent 0a4796c commit 03af4e3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,18 @@ void QgsFilteredTableWidget::populate( QgsValueRelationFieldFormatter::ValueRela

void QgsFilteredTableWidget::setIndeterminateState()
{
for ( int j = 0; j < mTableWidget->rowCount(); j++ )
for ( int rowIndex = 0; rowIndex < mTableWidget->rowCount(); rowIndex++ )
{
for ( int i = 0; i < mColumnCount; ++i )
for ( int columnIndex = 0; columnIndex < mColumnCount; ++columnIndex )
{
whileBlocking( mTableWidget )->item( j, i )->setCheckState( Qt::PartiallyChecked );
if ( item( rowIndex, columnIndex ) )
{
whileBlocking( mTableWidget )->item( rowIndex, columnIndex )->setCheckState( Qt::PartiallyChecked );
}
else
{
break;
}
}
}
}
Expand Down

0 comments on commit 03af4e3

Please sign in to comment.