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. Widgets (Drawn with QPaintEvent / QPainter) Randomly Stop Updating
Forum Updated to NodeBB v4.3 + New Features

Widgets (Drawn with QPaintEvent / QPainter) Randomly Stop Updating

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 303 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.
  • B Offline
    B Offline
    brny
    wrote on last edited by brny
    #1

    I have written an application that contains a decent number of windows (QDialogs) that are each populated with potentially a hundred or so customized widgets. Nothing too crazy in widget complexity, but they are all being drawn using QPainter in overridden paintEvent() calls.

    To summarize the application flow, as data is received by the core application it sends the data to each window. Inside each window's update call, a QRunnable is dispatched that iterates across all of that window's custom widgets, and determines which ones need to be updated for that particular incoming dataset. This is achieved using a signal and slot through a queued connection (Qt::QueuedConnection), where the slot triggers the main thread (as I understand it) to fire the paintEvent call for each updating widget.

    This works very well ... most of the time! As the application needs to be relatively long-running (days/weeks), these windows are being updated/drawn for extended periods of time. And sooner or later, I start getting cases where certain widgets seem to stop visually updating. They just kind of appear to be visually "frozen" ... and yet their counterparts (that update with the same dataset) continue updating, just fine.

    When this occurs, there is not high CPU utilization nor is there anything else special going on. To make matters more interesting, if I do something like click on the parent window's title bar, any of these "frozen" widgets in question update - just once, and they don't resume auto-updating going forward. I can keep clicking, and they keep updating. It's almost like clicking on the window causes a visual "flush" (update) to occur on all widgets.

    Any ideas as to what may be going on here? I'm pouring over my code trying to find a mistake I may have made, but I'm at a loss as to why visually giving focus (clicking) on a window provides a temporary fix. (This is not a something that I am monitoring or knowingly triggering off of)

    Qt 5.15.2 , Red Hat Enterprise Linux 8

    Thanks!

    1 Reply Last reply
    0
    • Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      Please use Qt >=6.5 and see if it stops happening.
      Otherwise, it's impossible to say what's going wrong.
      Can you isolate the behaviour in a minimal compilable example?

      Software Engineer
      The Qt Company, Oslo

      B 1 Reply Last reply
      0
      • Axel SpoerlA Axel Spoerl

        Please use Qt >=6.5 and see if it stops happening.
        Otherwise, it's impossible to say what's going wrong.
        Can you isolate the behaviour in a minimal compilable example?

        B Offline
        B Offline
        brny
        wrote on last edited by
        #3

        @Axel-Spoerl

        Thanks for your response. I have been (intentionally) using Qt 5.15.X as binaries produced from it appear to play very well with other RHEL 8 boxes, "out of the box". But maybe I need to bite the bullet (so to speak) and shift to Qt 6.

        I will also work to see if I can produce a minimally compilable example. Currently, my application is too complicated and requires data sources to reproduce. The "several days" of time going by before it appears is a bit discouraging of course.

        I did find this Stack Overflow discussion on the topic (see comments at the bottom re: time observance):

        https://stackoverflow.com/questions/27135590/qwidget-paintevent-stop-being-called-without-reason

        Thanks!

        1 Reply Last reply
        0
        • Axel SpoerlA Offline
          Axel SpoerlA Offline
          Axel Spoerl
          Moderators
          wrote on last edited by
          #4

          I think it's worth to bite the bullet. If it's really a bug in Qt (which I actually doubt), it's fairly unlikely that it will be fixed in 5.15.
          That's different for Qt 6 though.

          Software Engineer
          The Qt Company, Oslo

          1 Reply Last reply
          0

          • Login

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