How to set StringVectorProperty from a PropertyGroup panel_widget


(michal) #1

Hi, I am trying to create a panel widget for a group property, In my pqInteractiveSettingPropertyGroup, I am trying to set the value of SettingA, do I need to use

auto settingA = vtkSMIntVectorProperty::SafeDownCast(this->smProxy()->GetProperty(“SettingA”));
or
auto settingA = vtkSMIntVectorProperty::SafeDownCast(this->smGroup()->GetProperty(“SettingA”));

(smProxy or smGroup)

<StringVectorProperty 
     command="SetSettingA"
     default_values=""
     name="SettingA"
     number_of_elements="0"        
     number_of_elements_per_command="3"
     repeat_command="1"
     use_index="1"
     >

<StringVectorProperty 
     command="SetSettingB"
     default_values=""
     name="SettingB"
     number_of_elements="0"        
     number_of_elements_per_command="3"
     repeat_command="1"
     use_index="1"
     >

<PropertyGroup label="Settings"  panel_widget="InteractiveSettingPanel">
            <Property name="SettingA" /> 
            <Property name= "SettingB" />
  </PropertyGroup>

I am asking this, because I used to directly set the panel_widget inside property SettingA and by using smProxy()->GetProperty(“SettingA”) I could modify the property but now using property group it isn’t working anymore.

or do I need to link the properties?

thanks you


(Mathieu Westphal (Kitware)) #2

You need to add a property link. Take a look into Example/Plugins/PropertyWidget.


(michal) #3

You are right, I was missing the AddPropertLink

thanks