#3994 Fix crash when creating valves and no valve template is present

This commit is contained in:
Gaute Lindkvist 2019-01-28 15:23:54 +01:00
parent 80c99f452f
commit 64c30d00d1

View File

@ -224,6 +224,13 @@ void caf::PdmUiFormLayoutObjectEditor::recursivelyConfigureAndUpdateUiOrderingIn
// Apply margins determined by the editor type
fieldLabelWidget->setContentsMargins(fieldEditor->labelContentMargins());
}
else
{
if (fieldColumnSpan == PdmUiOrdering::LayoutOptions::MAX_COLUMN_SPAN)
{
fieldColumnSpan = itemColumnSpan;
}
}
fieldEditorWidget->setParent(containerWidgetWithGridLayout); // To make sure this widget has the current group box as parent.
parentLayout->addWidget(fieldEditorWidget, currentRowIndex, currentColumn + leftLabelColumnSpan, 1, fieldColumnSpan, Qt::AlignTop);