Skip to content

Commit 03af4e3

Browse files
elpasonyalldawson
authored andcommitted
Fix crash on value relation multi-column
Fix #54164
1 parent 0a4796c commit 03af4e3

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,18 @@ void QgsFilteredTableWidget::populate( QgsValueRelationFieldFormatter::ValueRela
157157

158158
void QgsFilteredTableWidget::setIndeterminateState()
159159
{
160-
for ( int j = 0; j < mTableWidget->rowCount(); j++ )
160+
for ( int rowIndex = 0; rowIndex < mTableWidget->rowCount(); rowIndex++ )
161161
{
162-
for ( int i = 0; i < mColumnCount; ++i )
162+
for ( int columnIndex = 0; columnIndex < mColumnCount; ++columnIndex )
163163
{
164-
whileBlocking( mTableWidget )->item( j, i )->setCheckState( Qt::PartiallyChecked );
164+
if ( item( rowIndex, columnIndex ) )
165+
{
166+
whileBlocking( mTableWidget )->item( rowIndex, columnIndex )->setCheckState( Qt::PartiallyChecked );
167+
}
168+
else
169+
{
170+
break;
171+
}
165172
}
166173
}
167174
}

0 commit comments

Comments
 (0)