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. Update interface widgets or QML by QTimer
Forum Updated to NodeBB v4.3 + New Features

Update interface widgets or QML by QTimer

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

    Hello everyone!

    I have faced with the following question and cannot find any best practices guide about it. I deal with widgets and QML interfaces and use signal-slots mechanism to update labels, meters, buttons, etc in GUI. My programs can display different states of the hardware devices. In some cases there are a lot of updates with different frequencies (some meters is being updated faster e.g.). In this case interface starts to freezing (using signals-slot approach).
    So my question is: is it a good practice to use special GUI timer (or multiple) to request backend for updates and redrawing the interface?
    Can someone advice any good article about this question?

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

      Hi,

      When you have frequencies input, what you would usually do is to cumulate the data and trigger updates less frequently e.g. by small or bigger batches.

      It does not make sense to try to update your UI at 240 fps as you users won't see anything anyway.

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

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        When you have frequencies input, what you would usually do is to cumulate the data and trigger updates less frequently e.g. by small or bigger batches.

        It does not make sense to try to update your UI at 240 fps as you users won't see anything anyway.

        S Offline
        S Offline
        St.Stanislav
        wrote on last edited by
        #3

        @SGaist Yes, that's actually I have meant: a have a lot of data changes and there is no need to update interfaces that 240 fps. So as I understood from your message, updating and collecting data with some constant frequency (e.g. 25 fps) is a common used practice with Qt, isn't it?

        Are there any built-in tools for it or it should be done manually? For example, adding Timer in any QML Component, connect its signals to function that update Components members with the updated data.

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

          No, collect the data as fast as you can. You then have to find the "sweet spot" to trigger the update of your UI. You need some benchmarking for that.

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