[vtkusers] How to use ProgressEvent with Qt 3?
Wagner Sales
wsalles2003 at yahoo.com.br
Tue May 2 18:56:30 EDT 2006
Hi all,
I'm trying to use the progress event from a vtkDICOMImageReader to
change the status ( percent ) on a QProgressBar widget.
I was readed the Examples/GUI/Qt, and based on this, StartEvent and
EndEvent are working fine to me by using the following code:
// my connections, based on vtkEventQtSlotConnect
m_connector->Connect( m_dicomReader, vtkCommand::EndEvent, this,
SLOT(slotEnded(vtkObject*)));
m_connector->Connect( m_dicomReader, vtkCommand::StartEvent, this,
SLOT(slotStarted(vtkObject*)));
// my slots:
void MyWidget::slotStarted(vtkObject* obj)
{
std::cout << "---> Dicom reader started!" << endl;
}
void MyWidget::slotEnded(vtkObject* obj)
{
std::cout << "---> Dicom reader ended!" << endl;
}
Well, before to set my QProgressBar progress I was just put some output
to std::cout ( code are at the end ).
Then, I'm trying to do the same with the ProgressEvent, but only one
time are showed to me the message:
-- Progress: 0
-- Progress Text:
Someone have some help or example to use then?
The code to understand are here:
//connection
m_connector->Connect( m_dicomReader, vtkCommand::ProgressEvent, this,
SLOT(slotProgressChanged(vtkObject*)));
//slot
void MyWidget::slotProgressChanged(vtkObject* obj)
{
vtkDICOMImageReader *r = vtkDICOMImageReader::SafeDownCast(obj);
std::cout << "-- Progress: " << r->GetProgress() << endl;
std::cout << "-- Progress text: " << r->GetProgressText() << endl;
}
Thnks in advance,
Wagner Sales
_______________________________________________________
Yahoo! doce lar. Faça do Yahoo! sua homepage.
http://br.yahoo.com/homepageset.html
More information about the vtkusers
mailing list