[Paraview-developers] pqPropertyWidget with paraview 4.1

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Mon Jan 27 10:16:34 EST 2014


Felipe,

Where is the code to SetElement(...) called? In general if you call
SetElement(..), there's no reason why you cannot simply call
proxy->UpdateVTKObjects() to push the changes immediately after. You're
already veering away from how the apply/reset mechanism operates.

For apply/reset to work correctly, pqPropertyWidget subclass shouldn't
change any SMProperty except in overloaded pqPropertyWidget::apply()
method. Anytime the pqPropertyWidget is "modified", it should instead fire
the pPropertyWidget::changeAvailable() and/or
pqPropertyWidget::changeFinished() signals. Then, on "Apply" (or "Reset"),
the appropriate apply()/reset() method will be called to update the
property.

Hopefully that's clarifies things a little. I am sure this could be
explained better, alas. Maybe if you send me the code I may be able to
explain better.

Utkarsh

On Mon, Jan 27, 2014 at 9:54 AM, Felipe Bordeu
<felipe.bordeu at ec-nantes.fr>wrote:

> Hi,
>
> I have my plugin (reader) with a custom panel (using the new
> architecture for panels). Everything was working perfectly in the 4.0.1
> version.
>
> But now (in v4.1 linux from web) all the changes BEFORE the first time I
> hit apply are ignored.
>
> I have a custom panel with a QTreeWidgetItem that is populated with the
> meta data of the file and I can check some items to be loaded. I use
> some logic to determine if the user can check a item or not. All the
> code reduce to:
>
> vtkSMStringVectorProperty *VisualizationSpaceStatus =
>
> vtkSMStringVectorProperty::SafeDownCast(proxy()->GetProperty("VisualizationSpaceStatus"));
> VisualizationSpaceStatus->SetElement(itemindex*2+1,state.c_str());
> VisualizationSpaceStatus->Modified ();
>
> to set the check state.
>
> Does anyone know why the first time I hit Apply the data is not
> transmitted to the server?????
>
> this is the xml part of this property:
>
>    <!--
> ================================================================== -->
>      <StringVectorProperty  name="VisualizationSpaceInfo"
> information_only="1" immediate_update="1">
>         <ArraySelectionInformationHelper
> attribute_name="VisualizationSpace"/>
>      </StringVectorProperty>
>
>      <StringVectorProperty
>         name="VisualizationSpaceStatus"
>         command="SetVisualizationSpaceStatus"
>         number_of_elements="0"
>         repeat_command="1"
>         number_of_elements_per_command="2"
>         element_types="2 0"
>         information_property="VisualizationSpaceInfo"
>         animateable="0"
>         label="Visualization Space"
>         panel_widget="SpaceTimeSelector"
>         >
>
>        <ArraySelectionDomain name="array_list" >
>           <RequiredProperties>
>              <Property name="VisualizationSpaceInfo" function="ArrayList"/>
>           </RequiredProperties>
>        </ArraySelectionDomain>
>      </StringVectorProperty>
>
>
> Thanks to all
>
> --
> Felipe Bordeu Weldt
> Ingénieur de Recherche
> -------------------------------------
> Tél. : 33 (0)2 40 37 16 57
> Fax. : 33 (0)2 40 74 74 06
> Felipe.Bordeu at ec-nantes.fr
> Institut GeM - UMR CNRS 6183
> École Centrale Nantes
> 1 Rue de La Noë, 44321 Nantes, FRANCE
> -------------------------------------
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20140127/242a5d94/attachment.html>


More information about the Paraview-developers mailing list