Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QLabel::setText() on inactive window of Mac
Qt 6.12 LTS is out! See what's new in the release blog

QLabel::setText() on inactive window of Mac

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

    Hi, this seems to be a bit of a tricky one. Problem observed on Qt 5.9, 5.12 and 5.15.

    In the app I am debugging on Mac, there is a main app window, and a non-modal tabbed settings window in which there are some QLabel items that get regularly updated with data values (a couple of times a second).

    The problem is that if the settings window is displayed, but is not on top (the main app window is on top), and the user is not interacting with the program, the label updates result in steadily increasing memory usage. Then after some time (10 minutes or more), when the user next tries to interact with the program, the program goes busy (spinning ball) for a significant time before resuming. Once the program has resumed, the memory usage has gone down somewhat.

    If the settings window is on top, the memory usage does not increase significantly.

    It seems like there are objects being queued for deletion by the label updates, but that these deletions are only processed when the owning window is on top, and otherwise are queued for an event loop that doesn't run until the user interacts with the program again.

    Is there a way to ensure these queued deletions get processed in the background as soon as they can be, rather than being queued up for a long time?

    One further data item is that an older version of the program did not use a tabbed dialog for the settings window, just a simple dialog, and it doesn't suffer from this problem. It seems that maybe the tabbed dialog somehow gives rise to the issue.

    This issue has only been observed on Mac, not on Windows or Linux.

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

      Hi and welcome to devnet,

      Can you provide a minimal compilable example that shows this behaviour ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      T 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Can you provide a minimal compilable example that shows this behaviour ?

        T Offline
        T Offline
        Tony Mountifield
        wrote on last edited by
        #3

        @SGaist That would be a significant challenge. The program exhibiting the issue (Jamulus) is large and complex.

        At this stage I was hoping to understand the principles involved with Qt, particularly how the event loop relates to a background window.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Is it hidden or just not active ?

          One thing you can do is use GammaRay to check what is going on.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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
          • Unsolved