mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 16:32:12 -05:00
#4090 Update fix for crash with no label editors
This commit is contained in:
1 parent
833a29c3c2
commit
a6d29c6f96
1 file changed
+6
-10
@@ -176,9 +176,9 @@ void caf::PdmUiFormLayoutObjectEditor::recursivelyConfigureAndUpdateUiOrderingIn
|
|||||||
labelAndFieldVerticalLayout, currentRowIndex, currentColumn, 1, itemColumnSpan, Qt::AlignTop);
|
labelAndFieldVerticalLayout, currentRowIndex, currentColumn, 1, itemColumnSpan, Qt::AlignTop);
|
||||||
labelAndFieldVerticalLayout->addWidget(fieldLabelWidget, 0, Qt::AlignTop);
|
labelAndFieldVerticalLayout->addWidget(fieldLabelWidget, 0, Qt::AlignTop);
|
||||||
labelAndFieldVerticalLayout->addWidget(fieldEditorWidget, 1, Qt::AlignTop);
|
labelAndFieldVerticalLayout->addWidget(fieldEditorWidget, 1, Qt::AlignTop);
|
||||||
|
|
||||||
// Apply margins determined by the editor type
|
// Apply margins determined by the editor type
|
||||||
fieldLabelWidget->setContentsMargins(fieldEditor->labelContentMargins());
|
fieldLabelWidget->setContentsMargins(fieldEditor->labelContentMargins());
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -198,10 +198,13 @@ void caf::PdmUiFormLayoutObjectEditor::recursivelyConfigureAndUpdateUiOrderingIn
|
|||||||
|
|
||||||
parentLayout->addWidget(fieldLabelWidget, currentRowIndex, currentColumn, 1, leftLabelColumnSpan, Qt::AlignTop);
|
parentLayout->addWidget(fieldLabelWidget, currentRowIndex, currentColumn, 1, leftLabelColumnSpan, Qt::AlignTop);
|
||||||
currentColumn += leftLabelColumnSpan;
|
currentColumn += leftLabelColumnSpan;
|
||||||
|
|
||||||
|
// Apply margins determined by the editor type
|
||||||
|
fieldLabelWidget->setContentsMargins(fieldEditor->labelContentMargins());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldLabelWidget && labelPos != PdmUiItemInfo::TOP) // Already added if TOP
|
if (labelPos != PdmUiItemInfo::TOP) // Already added if TOP
|
||||||
{
|
{
|
||||||
fieldColumnSpan += spareColumnsToAssign;
|
fieldColumnSpan += spareColumnsToAssign;
|
||||||
|
|
||||||
@@ -209,10 +212,6 @@ void caf::PdmUiFormLayoutObjectEditor::recursivelyConfigureAndUpdateUiOrderingIn
|
|||||||
fieldColumnSpan = std::max(1, fieldColumnSpan);
|
fieldColumnSpan = std::max(1, fieldColumnSpan);
|
||||||
|
|
||||||
parentLayout->addWidget(fieldEditorWidget, currentRowIndex, currentColumn, 1, fieldColumnSpan, Qt::AlignTop);
|
parentLayout->addWidget(fieldEditorWidget, currentRowIndex, currentColumn, 1, fieldColumnSpan, Qt::AlignTop);
|
||||||
|
|
||||||
// Apply margins determined by the editor type
|
|
||||||
fieldLabelWidget->setContentsMargins(fieldEditor->labelContentMargins());
|
|
||||||
|
|
||||||
currentColumn += fieldColumnSpan;
|
currentColumn += fieldColumnSpan;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,10 +220,7 @@ void caf::PdmUiFormLayoutObjectEditor::recursivelyConfigureAndUpdateUiOrderingIn
|
|||||||
QWidget::setTabOrder(*previousTabOrderWidget, fieldEditorWidget);
|
QWidget::setTabOrder(*previousTabOrderWidget, fieldEditorWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldLabelWidget)
|
previousTabOrderWidget = &fieldEditorWidget;
|
||||||
{
|
|
||||||
previousTabOrderWidget = &fieldLabelWidget;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
fieldEditor->updateUi(uiConfigName);
|
fieldEditor->updateUi(uiConfigName);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user