[vtk-developers] Problems using vtkCommand::ProcessEvent with Qt 3 by using vtkEventQtSlotConnect - Sorry by last ugly subject

Peeters, T.H.J.M T.Peeters at tue.nl
Thu May 4 19:38:26 EDT 2006


Hi,

I don't use Qt3 but 4. But I wrote a class that can be used to show progress of e.g. vtkAlgorithms and I thought I'd share it with you in case it may be useful for someone. It is not necessary to use Qt slots, just monitor the VTK events.

Simply use the class in the attached files and let it monitor progress events by:

this->ProgressCommand = QVTKProgressCommand::New();
SomeAlgorithm->AddObserver(vtkCommand::ProgressEvent, this->ProgressCommand);

A progress dialog is then automatically shown if SomeAlgorithm updates its progress with e.g. UpdateProgress(0.5). ProgressText is also displayed if available.

Tim.

Wagner Sales wrote:
> Hi VTK Developers,
>
> I was posted this message at vtk-users, but unfortunatelly, no answer was sended back. 
> Then, i'm posting here and put more two considerations:
> 1 - I suggest to include an example about this topic in future vtk releases ( Examples/GUI/Qt/Events ).
>
>
> 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?
>
>
>
> 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. 
>
> Thks a lot by any suggestions, example...
>
>
> Wagner sales

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 7504 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20060505/a3efa990/attachment-0001.bin>


More information about the vtk-developers mailing list