Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. paint/event loop slowing down.
Forum Updated to NodeBB v4.3 + New Features

paint/event loop slowing down.

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pmh4514
    wrote on last edited by pmh4514
    #1

    In my Qt5 Widgets (windows) application I have a long running process that opens a window, draws images into it which are captured off a camera, closes the window and then repeats..

    If I put elapsedTimer's within my various paintEvent handlers and log the results, I can see that the actual execution time of my paintEvent handlers isn't slowing down (they all tend to be 2-3ms) and I've verified that the frame-rate of the external camera and the thread pulling frames off it is not slowing down.

    At the start, my logging shows paint is happening roughly 25-30 times per second.

    Over time though, my logging shows it slowing down to the point where after running for roughly a half hour, I'm seeing that my paintEvent is happening only once every 2-3 seconds, creating a noticeable lag.. At the same time, I can tell that mouse-event handling gets very laggy as well. It's as if the whole event loop is getting bogged down. But all my logging (ie. timing various paint and mouse event handling internally) shows that the actual execution time of my various handlers isn't increasing, nor do I see in task manager any evidence of memory leaks. If I turn off all my logging, the behavior is unchanged.

    What are some things I might look to to help figure out what is bogging down the event loop?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hmm
      Did you check the OS state when it becomes slow?
      Its not massive ram usage or fragmentation?

      P 1 Reply Last reply
      2
      • mrjjM mrjj

        Hmm
        Did you check the OS state when it becomes slow?
        Its not massive ram usage or fragmentation?

        P Offline
        P Offline
        pmh4514
        wrote on last edited by
        #3

        Yah, nothing seems out of the ordinary as far as task manager, threads, handle count or even CPU utilization, and I can switch to other programs and they all run smooth.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          pmh4514
          wrote on last edited by
          #4

          Turns out it has nothing to do with Qt, for all intents.. I had a GUI control which could be controlled by the user but would also update itself based on externally generated events (from hardware).. there was a sort of signal/slot recursion going on for an ever increasing number of children objects.. A bit of refactoring and the problem went away.

          1 Reply Last reply
          2

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved