Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Visual update

    General and Desktop
    3
    11
    1711
    Loading More Posts
    • 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
      David King last edited by David King

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 2
        • D
          David King last edited by David King

          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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 1
            • D
              David King @SGaist last edited by

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

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 Reply Quote 0
                • D
                  David King @SGaist last edited by

                  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.

                  mrjj 1 Reply Last reply Reply Quote 0
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    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 Reply Quote 0
                    • mrjj
                      mrjj Lifetime Qt Champion @David King last edited by

                      @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 Reply Quote 0
                      • D
                        David King @mrjj last edited by David King

                        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 Reply Quote 0
                        • SGaist
                          SGaist Lifetime Qt Champion last edited by

                          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 Reply Quote 0
                          • First post
                            Last post