Results 1 to 2 of 2

Thread: Moving window freezes event loop

  1. #1
    Join Date
    Jun 2011
    Posts
    38
    Thanks
    8
    Thanked 1 Time in 1 Post

    Default Moving window freezes event loop

    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!

  2. #2
    Join Date
    Jun 2011
    Posts
    38
    Thanks
    8
    Thanked 1 Time in 1 Post

    Default Re: Moving window freezes event loop

    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.

  3. The following user says thank you to P@u1 for this useful post:

    ibanez2006 (25th September 2013)

Similar Threads

  1. QT event loop
    By theprobe in forum Newbie
    Replies: 1
    Last Post: 26th January 2011, 13:21
  2. GUI freezes in loop: Thread does not help?
    By Matty23 in forum Qt Programming
    Replies: 4
    Last Post: 25th November 2010, 21:04
  3. Replies: 10
    Last Post: 15th January 2010, 14:35
  4. Event Loop
    By node_ex in forum Qt Programming
    Replies: 1
    Last Post: 12th December 2008, 07:52
  5. Replies: 0
    Last Post: 23rd October 2008, 12:43

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.