<pre>Hi VTK Developers,<br><br>I was posted this message at vtk-users, but unfortunatelly, no answer was sended back. <br>Then, i'm posting here and put more two considerations:<br>1 - I suggest to include an example about this topic in future vtk releases ( Examples/GUI/Qt/Events ).
<br>2 - I was tried just with the vtkDICOMImageReader, not with others filters. In ITK this problem only occurs with readers, but I was gived the desired behaviour with others filters (e.g segmentation filters). May be in VTK are the same?
<br>
Since I'm using Qt, i'm familiar with the slot/connection facilty, but not so familiar with the add observer pattern, just by I was readed in vtk books. <br><br>Thks a lot by any suggestions, example...<br><br>Wagner sales
<br><br>--- POSTED MESSAGE:<br>Hi all,<br><br>I'm trying to use the progress event from a vtkDICOMImageReader to<br>change the status ( percent ) on a QProgressBar widget.<br>I was readed the Examples/GUI/Qt, and based on this, StartEvent and
<br>EndEvent are working fine to me by using the following code:<br><br>   // my connections, based on vtkEventQtSlotConnect<br>    m_connector->Connect( m_dicomReader, vtkCommand::EndEvent, this,<br>SLOT(slotEnded(vtkObject*)));
<br>    m_connector->Connect( m_dicomReader, vtkCommand::StartEvent, this,<br>SLOT(slotStarted(vtkObject*)));<br>   // my slots:<br>void MyWidget::slotStarted(vtkObject* obj)<br>{<br>    std::cout << "---> Dicom reader started!" << endl;
<br>}<br>void MyWidget::slotEnded(vtkObject* obj)<br>{<br>     std::cout << "---> Dicom reader ended!" << endl;<br>}<br><br>Well, before to set my QProgressBar progress I was just put some output<br>
to std::cout ( code are at the end ).<br>Then, I'm trying to do the same with the ProgressEvent, but only one<br>time are showed to me the message:<br>-- Progress: 0<br>-- Progress Text:<br><br>Someone have some help or example how to use?
<br>The code to understand are here:<br><br>//connection<br>m_connector->Connect( m_dicomReader, vtkCommand::ProgressEvent, this,<br>SLOT(slotProgressChanged(vtkObject*)));<br><br>//slot<br>void MyWidget::slotProgressChanged(vtkObject* obj)
<br>{<br>    vtkDICOMImageReader *r = vtkDICOMImageReader::SafeDownCast(obj);<br>    std::cout << "-- Progress: " << r->GetProgress() << endl;<br>    std::cout << "-- Progress text: " << r->GetProgressText() << endl;
<br>}<br><br>Thnks in advance,<br><br>Wagner Sales<br><br><br><br></pre>