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. What is the best way of determining whether or not Qt is checking for user input at a reasonable rate.
Forum Update on Monday, May 27th 2025

What is the best way of determining whether or not Qt is checking for user input at a reasonable rate.

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 579 Views
  • 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.
  • H Offline
    H Offline
    Hasan Al-Baghdadi
    wrote on last edited by aha_1980
    #1

    I have multiple elements on screen and some may lower down performance.
    I wanted to ensure that my software stays comfortable to use during these moments, so I decided to use external framerate calculators such as perfstudio and fraps, but it turns out that framerate is not tied with visual updates.
    Is there some method of calculating how often Qt checks for input (I assume this happens once per loop)?
    And is there a way to ensure the main loop runs on a separate thread if I'm primarily using qml?

    Thanks.

    JonBJ 1 Reply Last reply
    0
    • H Hasan Al-Baghdadi

      I have multiple elements on screen and some may lower down performance.
      I wanted to ensure that my software stays comfortable to use during these moments, so I decided to use external framerate calculators such as perfstudio and fraps, but it turns out that framerate is not tied with visual updates.
      Is there some method of calculating how often Qt checks for input (I assume this happens once per loop)?
      And is there a way to ensure the main loop runs on a separate thread if I'm primarily using qml?

      Thanks.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Hasan-Al-Baghdadi
      I don't think "how often Qt checks for input (I assume this happens once per loop)" is how it works.
      If by "main loop runs on a separate thread" you mean the UI thread, then that cannot run "separate", all UI operations must be in one main thread. "Separate thread" from what?

      1 Reply Last reply
      1
      • H Offline
        H Offline
        Hasan Al-Baghdadi
        wrote on last edited by
        #3

        I don't think "how often Qt checks for input (I assume this happens once per loop)" is how it works.

        How does it work then, there seems to be a delay if the software is slowing down?

        If by "main loop runs on a separate thread" you mean the UI thread, then that cannot run "separate", all UI operations must be in one main thread. "Separate thread" from what?

        I meant having all the qml code that runs as a result of UI interactions running on a separate thread from the one that checks for user actions and other signals. As far as I understand this is doable in C++ by creating external threads that manage everything outside of the main UI loop.

        JonBJ 1 Reply Last reply
        0
        • H Hasan Al-Baghdadi

          I don't think "how often Qt checks for input (I assume this happens once per loop)" is how it works.

          How does it work then, there seems to be a delay if the software is slowing down?

          If by "main loop runs on a separate thread" you mean the UI thread, then that cannot run "separate", all UI operations must be in one main thread. "Separate thread" from what?

          I meant having all the qml code that runs as a result of UI interactions running on a separate thread from the one that checks for user actions and other signals. As far as I understand this is doable in C++ by creating external threads that manage everything outside of the main UI loop.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @Hasan-Al-Baghdadi
          I'll have to leave it to others who know better than I to comment. But I doubt that anything works by having one thread for output to user and a separate thread for input. I admit I know nothing about QML, but a standard Qt widgets program only has a single thread for everything, UI or not, unless you choose to create extra threads for some reason for your back-end code, and works fine.

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

            Hi,

            What items do make you lose performance ? What are they doing ?

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

            H 1 Reply Last reply
            2
            • SGaistS SGaist

              Hi,

              What items do make you lose performance ? What are they doing ?

              H Offline
              H Offline
              Hasan Al-Baghdadi
              wrote on last edited by
              #6

              @SGaist The strip chart that updates dozens of times a second is the biggest culprit, if a lot of data comes through it could slow the interactivity down.

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

                Then you should rather optimise that part to work better. For example optimise the number of updates, the data processing. Maybe move that part to a thread to minimise the impact of processing, etc.

                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