PDA

View Full Version : Moving window freezes event loop



P@u1
11th July 2011, 10:40
Hi everyone,

I wrote a qt application, which receives data from the serial port, plots it and writes it to a file.

I noticed that when I move the window around or just hold the mouse pressed on the title bar, the
onReadyRead and timerEvent
slots are not called anymore.

So when I do this for some time the data I would have received from the serial port is lost, probably because some buffers of the os decided to drop data as there were to much of it...

How can I fix this?
The only thing I can imagine is using a different thread, which reads the serial port.
But if it's possible I want to avoid this...

Thanks for help in advance!

P@u1
11th July 2011, 16:19
I moved it to an own thread...
The new plot values are transfered by queued connection to the gui thread.
For some reason now even while I'm moving the window, the plot is updated, which before was not the case.
And more important now there is no data lost :-)

It was somehow inconvinient, but helped even more as I expected.