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. Visual update

Visual update

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 3 Posters 2.2k 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.
  • D Offline
    D Offline
    David King
    wrote on last edited by David King
    #1

    Hi,

    Anyone know if Qt does anything smart like limiting the render/repaint rate, to the display adaptor rate (eg 60Hz), so as not to unnecessarily burn CPU+GPU cycles, rendering visuals that the user will never see ?

    Or whether Qt aligns the rendering to the frame start (eg start of each 60Hz cycle), or double-buffers and transfers at that point, to avoid tearing? I think not, as I see tearing in the highlight, when I repeatedly click a button. But maybe that's dependent on the graphics platform in use ..

    Lastly, can a frames-per-second figure be obtained from Qt, for the whole window, or perhaps on a per-widget basis, to know how often it's repainting, in the case of changing content ?

    I've looked for answers to these 3, on the forum/docs/google, but drawn a blank. Kind of surprised about that. I'm probably not searching for quite the right thing ..

    Why do I want to know ?

    Because it might guide which way I take some optimisation of my design ..

    Many thanks,

    David

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

      Hi,

      Qt doesn't go faster than your display rate unless you manually try to repaint faster than that.

      Qt tries to avoid useless repaint when not needed.

      The rendering might get as fast as the adapter but it will depend on what you do and the processing time you need.

      You'll likely be interested by KDAB's GammaRay to inspect your application.

      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
      2
      • D Offline
        D Offline
        David King
        wrote on last edited by David King
        #3

        Great stuff, thanks for that SGaist

        All understood. And I'm just reading the KDAB GammaRay page ..

        .. what about a frames-per-second figure available at runtime though, that I have my app display on-screen ?

        Only needs to be updated on-screen once a second ..

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

          AFAIK, that's something you have to do by hand overloading the paint event for example.

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

          D 1 Reply Last reply
          1
          • SGaistS SGaist

            AFAIK, that's something you have to do by hand overloading the paint event for example.

            D Offline
            D Offline
            David King
            wrote on last edited by
            #5

            Which is something I can't do I imagine in my js+ui only world ..
            .. oh well

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

              Do you mean QtQuick or Html + JavaScript ?

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

              D 1 Reply Last reply
              0
              • SGaistS SGaist

                Do you mean QtQuick or Html + JavaScript ?

                D Offline
                D Offline
                David King
                wrote on last edited by
                #7

                Hmm, I'm not sure. We're using Qt Script only, not fullblown Qt. Our vendor tool, a Windows .exe, launches our .js. Which then in turn, courtesy a vendor-specific command, loads our .ui file. And only via this route, not fullblown Qt, can we access the vendor comms function library, they inform us. In think actually the vendor exe itself, might be written in fullblown Qt. I mean to ask them. There are 15 Qt5*.dll files, within the vendor Program Files subfolder. To make a .ui, the vendor told us to to download Qt, and use Qt Creator.

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

                  Qt Script ?

                  It has been deprecated and removed since Qt 5.7.

                  What version of Qt does that application use ?

                  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
                  • D David King

                    Hmm, I'm not sure. We're using Qt Script only, not fullblown Qt. Our vendor tool, a Windows .exe, launches our .js. Which then in turn, courtesy a vendor-specific command, loads our .ui file. And only via this route, not fullblown Qt, can we access the vendor comms function library, they inform us. In think actually the vendor exe itself, might be written in fullblown Qt. I mean to ask them. There are 15 Qt5*.dll files, within the vendor Program Files subfolder. To make a .ui, the vendor told us to to download Qt, and use Qt Creator.

                    mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @David-King
                    Hi
                    http://doc.qt.io/archives/qt-4.8/qt-script-qstetrix-tetrixboard-js.html
                    You can create widgets and paint from Qt script so
                    its not the issue of being able to paint a FPS number.
                    However, Qt does not redraw over and over like a game would and
                    im not sure I understand how you would show a meaningful number since the
                    ventor tool is the host.
                    It would make sense if you open a window and draw a bitmap over and over and
                    to see how fast it can go but for a GUI app with multiple widgets im confused.

                    D 1 Reply Last reply
                    0
                    • mrjjM mrjj

                      @David-King
                      Hi
                      http://doc.qt.io/archives/qt-4.8/qt-script-qstetrix-tetrixboard-js.html
                      You can create widgets and paint from Qt script so
                      its not the issue of being able to paint a FPS number.
                      However, Qt does not redraw over and over like a game would and
                      im not sure I understand how you would show a meaningful number since the
                      ventor tool is the host.
                      It would make sense if you open a window and draw a bitmap over and over and
                      to see how fast it can go but for a GUI app with multiple widgets im confused.

                      D Offline
                      D Offline
                      David King
                      wrote on last edited by David King
                      #10

                      Hi SGaist,

                      I had to laugh ! Like being on a boat you learn has got a hole in !!
                      Yeah, I only found out Qt Script had been deprecated, after we had opted for that vendor tool !
                      We did loads of presales research, including about their scripting language, but obviously not enough !

                      Beforehand, I'd not encountered Qt Script or Qt, it's cool !
                      Anyways, yes, deprecated, but not sure about removed since Qt 5.7:
                      The tool Help > About Qt, says it uses Qt version 5.9.3
                      Windows Properties > Details on the 15 Qt5*.dll files in the tool Program Files folder, say the same

                      In case of interest, tool demo version link, is https://www.emtas.de/en/download/canopen-deviceexplorer-demo
                      I mean to ask the vendor, purely out of interest, if the tool itself, is written in fullblown Qt
                      I've a sense it may be ..

                      Hi mrjj,

                      Cool, yes I mean to have a look at the Qt Script examples, they're doing amazing stuff,
                      way above what I'm doing with basic .ui widgets and .js
                      Yes about an FPS number, I'd be interesting in grabbing from somewhere within the Qt system -
                      displaying it I'm fine with
                      Sure sure I can understand that Qt only redraws if it needs to, which is great
                      I've got values incoming to my .js (from a CANopen comms link as happens),
                      and I show those values on-screen, jittering away
                      The values are changing at rate of up to 150 Hz
                      I know that much, because for each value, I count change
                      And every second, show the count total on-screen, then zero, in rough terms
                      I was just kind of interested, if I can get an FPS value from the Qt system
                      And if so, whether I would see 150, or 60
                      From what SGaist said, sounds like 60 ..

                      Best regards,

                      David

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

                        You can still build the module and use it if you really have to. It's just not further developed nor offered as pre-built package.

                        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