Is there a "simple" way to show the FPS (frame rate) in a QML/c++ application. All animations and views are done in QML and the application logic is in c++.
I already tried setting QML_SHOW_FRAMERATE
in Linux before starting the application but it didn't help:
export QML_SHOW_FRAMERATE=1
QML FPS Counter, without affecting performance.
Project of QNanoPainter and others in qt-labs are using the refresh of an animation of a QML Item to create an FPS counter. It's so easy to being done, attached a project that uses this technique ( modified from QNanoPainter FPS counter ).
FpsItem code:
Using it as:
You have to create your own FPS QQuickItem (or QQuickPaintedItem) and register in your main.cpp to be available in your QML code.
Here an example.
qml:
You can get any other implementation in Internet with a quick search.