Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.12.1
-
None
-
Next
Description
Setting MonitorModel.running and FrameTimer.running to true breaks frame timer.
model: MonitorModel { id: monitorModel2 running: true maximumCount: 20 // Just put a FrameTimer inside a MonitorModel and you can use it as a data source // There's no need to set its running property as the MonitorModel will take care of asking // it to update itself when appropriate. // FrameTimer will calculate the frame rate numbers for the given window FrameTimer { id: frameTimer // no sense in trying to update the FrameTimer while the window has no surface (or has just an empty one) running: window && window.contentState === WindowObject.SurfaceWithContent window: model.window onAverageFpsChanged: { console.warn (frameTimer.averageFps) // console.warn (model.averageFps) // fpsOverlay.averageFps = frameTimer.averageFps } // Component.onCompleted: { // fpsOverlay.averageFps = Qt.binding(function(){return frameTimer.averageFps}) // } } }
Output:
[WARN | qml] 25.01580999191489 [main.qml:340] [WARN | qml] 0 [main.qml:340] [WARN | qml] 24.982362452108813 [main.qml:340]
As you can see onAverageFpsChanged is fired twice.