#8952 Only include fields to be modified for sub items on/off

Only one fieldChanged is issued, and make sure that all fields in the selection will change state. If state is not changed for the last field, no notification will happen.
This commit is contained in:
Magne Sjaastad 2022-05-26 17:44:07 +02:00
parent b17e3813df
commit a511bfd722

View File

@ -204,6 +204,10 @@ std::vector<caf::PdmField<bool>*> RicToggleItemsFeatureImpl::findToggleFieldsFro
if ( uiObjectHandleChild && uiObjectHandleChild->objectToggleField() )
{
auto* field = dynamic_cast<caf::PdmField<bool>*>( uiObjectHandleChild->objectToggleField() );
if ( !field ) continue;
if ( state == SelectionToggleType::TOGGLE_ON && field->value() ) continue;
if ( state == SelectionToggleType::TOGGLE_OFF && !field->value() ) continue;
fields.emplace_back( field );
}