Uploaded image for project: 'Qt Automotive Suite'
  1. Qt Automotive Suite
  2. AUTOSUITE-910

Setting both, MonitorModel.running and FrameTimer.running to true breaks frame timer.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.12.1
    • Qt Application Manager
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            rgriebl Robert Griebl
            georgleugner Georg Leugner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes