Does the main window only update after a slot subroutine returns?
I don't know if I can explain this problem without posting reams of code,
but here goes.
I have a Qt app which is supposed to display a sequence of images. Each
image is displayed in the main Qt window by using a QLabel. To display
each image, I wrote a subrotuine called DisplayImg(int i) where the
integer i is the frame number. It works for displaying single images.
I then created a 'Play' button (in Qt) which is supposed to play a
sequence of images. The Play button is connected to a slot which is named
on_Play_clicked(). That is a subroutine which does this:
for (i = 0 ; i < N ; i++)
DisplayImg(i);
The problem is that the display only changes for the final image in the
sequence. None of the intermediate images are displayed, even though I
know (from printf()) that DisplayImg() is called for all intermediate
images.
Is that enough information to explain the problem? Am I misunderstanding
how the slot works? Does the main Qt window not update until the
subroutine on_Play_clicked() returns?
No comments:
Post a Comment