QML and frame rate

Hello everyone.
Is there any way I can see the frame rate of an QML applicaiton. I looked in QML viewer and didn't find anything. if I create a c++ program and use QDeclarative, is there any way I can print the framerate?

How can you display this framerate on a screen, in your QML Rectangle for instance, rather than in the terminal output? And can you use a timer to refresh the value only a certain amount of time by second to not sacrifice the refresh itself?

Grep the source code of Qt for QML_SHOW_FRAMERATE and see how it's done there then replicate it yourself as I suspect it may use some private API (but I've not looked so I can't be certain). Once you have calculated the framerate just expose it to QML like any other data by exposing it as a property on a QObject and calling QDeclarativeContext::setContextProperty().