#3583 Property Editor : Set unused grid cells to stretch 0

This commit is contained in:
Magne Sjaastad 2018-11-02 14:58:08 +01:00
parent a3aeb424b3
commit 2143673aa7

View File

@ -241,10 +241,17 @@ void caf::PdmUiFormLayoutObjectEditor::recursivelyConfigureAndUpdateUiOrderingIn
}
}
}
// Set last row to stretch
if (currentRowIndex >= 0)
// Set last row with content to stretch
if (currentRowIndex >= 0 && currentRowIndex < parentLayout->rowCount())
{
parentLayout->setRowStretch(currentRowIndex, 1);
parentLayout->setRowStretch(currentRowIndex++, 1);
}
// Set remaining rows to stretch zero, as we want the row with content to stretch all the way
while (currentRowIndex >= 0 && currentRowIndex < parentLayout->rowCount())
{
parentLayout->setRowStretch(currentRowIndex++, 0);
}
}