Qt Editor: Fix evaluation of ValueKey in enum option when changing child delegate value

qteditor
Sven Eberhardt 2016-07-12 22:29:24 -04:00
parent 097ff2c9fb
commit 3c84f9e6f8
1 changed files with 6 additions and 5 deletions

View File

@ -802,11 +802,6 @@ void C4PropertyDelegateEnum::UpdateEditorParameter(C4PropertyDelegateEnum::Edito
{
// Showing current selection: From last_val assigned in SetEditorData
parameter_val = editor->last_val;
if (option.value_key)
{
C4PropList *props = editor->last_val.getPropList();
if (props) props->GetPropertyByS(option.value_key.Get(), &parameter_val);
}
}
else
{
@ -816,6 +811,12 @@ void C4PropertyDelegateEnum::UpdateEditorParameter(C4PropertyDelegateEnum::Edito
// (note that actual setting is delayed by control queue and this may often the wrong value in some cases - the correct value will be shown on execution of the queue)
SetOptionValue(editor->last_get_path, option);
}
// Resolve parameter value
if (option.value_key)
{
C4PropList *props = editor->last_val.getPropList();
if (props) props->GetPropertyByS(option.value_key.Get(), &parameter_val);
}
// Show it
editor->parameter_widget = option.adelegate->CreateEditor(factory, editor, QStyleOptionViewItem(), by_selection);
if (editor->parameter_widget)