I'm sparkling brand new to Qt, and am finding it very rewarding to learn. I'm trying to merge some existing C++ code with a new Qt GUI. Basically, the idea is to have images that are extracted from an .avi file be processed in the backend and then displayed in a QLabel
on-screen. I have managed to get the following bit of code to display the frames correctly:
while (frame = cvQueryFrame(capture))
{
// Some processing code...
QImage qImageFrame((uchar*) frame->imageData, frame->width, frame->height, frame->widthStep, QImage::Format_RGB888);
qImageFrame = qImageFrame.rgbSwapped();
QPixmap qFrame;
qFrame.convertFromImage(qImageFrame);
label->setPixmap(qFrame);
label->repaint();
cvWaitKey(10);
}
Now, however, this obviously means that the UI stops being responsive to user input until all the frames from the movie are displayed. How is something like this done?
NB: I am performing the processing using the openCV library, which expects the images in a certain format. One thing which I think I cannot do, for example, is work with the .avi file directly in the Qt domain.