From 5a18442ed1c19559497118bebf0602a9a35f7b50 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 9 Aug 2023 17:09:11 +0200 Subject: [PATCH] #10483 Use list editor for proxy of vector of string --- Fwk/AppFwk/cafUserInterface/cafPdmUiFieldEditorHelper.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiFieldEditorHelper.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiFieldEditorHelper.cpp index e5e2404be9..1d9614bed0 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiFieldEditorHelper.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiFieldEditorHelper.cpp @@ -71,6 +71,14 @@ caf::PdmUiFieldEditorHandle* caf::PdmUiFieldEditorHelper::createFieldEditorForFi { fieldTypeName = caf::PdmUiListEditor::uiEditorTypeName(); } + else if ( fieldTypeName.indexOf( "PdmProxyValueField" ) != -1 && fieldTypeName.indexOf( "std::vector" ) != -1 && + fieldTypeName.indexOf( "QString" ) != -1 ) + { + // The PdmUiTreeSelectionEditor is the default editor for PdmProxyValueField>, but does + // not work for proxy fields. Use setUiEditorTypeName() to override the default editor. + // https://github.com/OPM/ResInsight/issues/10483 + fieldTypeName = caf::PdmUiListEditor::uiEditorTypeName(); + } else if ( field->toUiBasedQVariant().type() != QVariant::List ) { // Handle a single value field with valueOptions: Make a combobox