How can I measure time passed since the moment I have changed source or sourceComponent property of QML Loader to the moment visual item actually appeared on the screen (got painted)?
Loader {
id: _loader
source: "MyVisualItem.qml"
}
I already tried using statusChanged and Component.onCompleted signals but neither is accurate enough - it is easy to see that actual time is significantly greater.
According to the diagram in the documentation,
frameSwapped()is your best bet:You'll want to connect to that signal before setting
source/sourceComponent, or directly afterwards. The first time it's called you can check the time it took to render it on screen. Don't forget to disconnect it afterwards. :)