Hi all,

I am trying to do a progress bar in a filter. I did the following steps:
1- add an information only property to my xml to pass the progress
status to the client:

      <IntVectorProperty
        name="currentIteration"
        command="GetcurrentIteration"
        number_of_elements="1"
        information_only="1"
        default_values="0"
        immediate_update="1">
        <SimpleIntInformationHelper/>
      </IntVectorProperty>

2 - connect this property to a slot in the client to update the
progress bar value:

        this->currentIteration = vtkSMIntVectorProperty::SafeDownCast(
                this->proxy()->GetProperty("currentIteration"));
        this->QVTKConnect = vtkSmartPointer<vtkEventQtSlotConnect>::New();
        this->QVTKConnect->Connect(currentIteration, vtkCommand::ModifiedEvent,
                this, SLOT(updateProgressBar()),0,0, Qt::DirectConnection);

3- I update the value of the progress bar in the Slot:
void pqMyFilter::updateProgressBar()
{
        this->progressBar->setValue(this->currentIteration->GetElement(0));
        QCoreApplication::processEvents();
}

The value of the progress bar is updated only when requestData is
done. Is that mean the immediate_update of an
information only property doesn't work ?

Thank you !
_______________________________________________
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

Reply via email to