diff --git a/cafUserInterface/cafPdmUiDefaultObjectEditor.cpp b/cafUserInterface/cafPdmUiDefaultObjectEditor.cpp index 53ddc42b9c..d79c08c9dd 100644 --- a/cafUserInterface/cafPdmUiDefaultObjectEditor.cpp +++ b/cafUserInterface/cafPdmUiDefaultObjectEditor.cpp @@ -262,6 +262,8 @@ void PdmUiDefaultObjectEditor::recursiveSetupFieldsAndGroups(const std::vector
editorWidget(); + if (labelPos != PdmUiItemInfo::HIDDEN) { QWidget* fieldLabelWidget = fieldEditor->labelWidget(); @@ -271,7 +273,12 @@ void PdmUiDefaultObjectEditor::recursiveSetupFieldsAndGroups(const std::vector
addWidget(fieldLabelWidget, currentRowIndex, 0, 1, colSpan, Qt::AlignTop); + // If the label is on the side, and the editor can expand vertically, allign the label with the top edge of the editor + if (!labelOnTop && (fieldEditorWidget->sizePolicy().verticalPolicy() & QSizePolicy::ExpandFlag)) + parentLayout->addWidget(fieldLabelWidget, currentRowIndex, 0, 1, colSpan, Qt::AlignTop); + else + parentLayout->addWidget(fieldLabelWidget, currentRowIndex, 0, 1, colSpan, Qt::AlignVCenter); + fieldLabelWidget->show(); if (labelOnTop) currentRowIndex++; @@ -284,7 +291,6 @@ void PdmUiDefaultObjectEditor::recursiveSetupFieldsAndGroups(const std::vector
editorWidget(); if (fieldEditorWidget) {