[Paraview] linking vtkSMStringVectorProperty to a SLOT

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Apr 9 09:00:10 EDT 2009


There;s no direct way around this. You can handle it in use Qt code by
using a singleshot timer and calling some other slot only on idle.
Alternatively try to look at the code that's modifying the "Array"
property. Instead of using the SetElement() API, change it to using
the SetElements() API which modifies all elements and then fires the
modified event.

Utkarsh

On Thu, Apr 9, 2009 at 8:21 AM, Nehme Bilal <nehmebilal at gmail.com> wrote:
> Hi again,
>
> I found a way that seems to work, but I still have a problem.
> The StringVectorProperty I'm using look like this:
>
>      <StringVectorProperty
>         name="Arrays"
>         command="SetArrays"
>         repeat_command="1"
>         number_of_elements_per_command="2"
>         element_types="2 0">
>      </StringVectorProperty>
>
> to connect this property to a Qt SLOT, I used:
>
> vtkSmartPointer<vtkEventQtSlotConnect> VTKConnect =
>                            vtkSmartPointer<vtkEventQtSlotConnect>::New();
> VTKConnect->Connect(arrays, vtkCommand::ModifiedEvent,
>                this, SLOT(onArraysModified()));
>
> because repeat_command=1 the SLOT will be called every time an element
> is modified in the StringVectorProperty
> and that will cause a slow excecution if the number of elements in the
> StringVectorProperty is to big.
> Is there a way around this ?
>
> Thanks
>
> 2009/4/9 Nehme Bilal <nehmebilal at gmail.com>:
>> Hi All,
>>
>> I have a StringVectorProperty that I'm trying to link to a Qt SLOT in
>> the client side of my plugin. I want the SLOT to be called when the
>> StringVectorProperty is modified.
>> Is that possible ?
>>
>> Thanks you
>> Nehme
>>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>


More information about the ParaView mailing list