From 64c30d00d10d1305820b0fb5c5e21419f48318c2 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Mon, 28 Jan 2019 15:23:54 +0100 Subject: [PATCH] #3994 Fix crash when creating valves and no valve template is present --- .../cafUserInterface/cafPdmUiFormLayoutObjectEditor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiFormLayoutObjectEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiFormLayoutObjectEditor.cpp index 3d45b3a4f8..54cc7a18d2 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiFormLayoutObjectEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiFormLayoutObjectEditor.cpp @@ -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);