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 ..
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.
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 ..
AFAIK, that's something you have to do by hand overloading the paint event for example.
Which is something I can't do I imagine in my js+ui only world ..
.. oh well
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.
Qt Script ?
It has been deprecated and removed since Qt 5.7.
What version of Qt does that application use ?
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.
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 ..
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 ..
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.