Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-47885

Animators don't run until after expensive operations in asynchronous Loaders have finished

    XMLWordPrintable

Details

    Description

      I'm making a splash screen for a Qt Quick-based game.

      Expected behaviour

      The splash screen should show and begin to animate before the game starts loading. The output from the attached project should look something like this:

      17:538 onStarted: SplashScreen fade in animation started
      17:538 onCompleted: SplashScreen item loaded
      17:584 ExpensiveJsonType::ExpensiveJsonType: constructing ExpensiveJsonType...
      17:738 onStopped: SplashScreen fade in animation finished
      18:850 ExpensiveJsonType::ExpensiveJsonType: ... constructed ExpensiveJsonType
      18:860 onCompleted: GameScreen item loaded; ready to fade out splash screen
      19:096 onStarted: SplashScreen fade out animation started
      19:329 onStopped: SplashScreen fade out animation finished
      

      Run the application with QT_MESSAGE_PATTERN set to:

      %{time ss:zzz} %{function}: %{message}

      In order to get the timing information in the output.

      Actual behaviour

      The splash screen shows before the game starts loading, but does not start animating until after the game has loaded, and hence the animation takes 1.5 seconds instead of 0.2 seconds to complete.

      With the attached project, the output is:

      17:538 onStarted: SplashScreen fade in animation started
      17:538 onCompleted: SplashScreen item loaded
      17:584 ExpensiveJsonType::ExpensiveJsonType: constructing ExpensiveJsonType...
      18:850 ExpensiveJsonType::ExpensiveJsonType: ... constructed ExpensiveJsonType
      18:860 onCompleted: GameScreen item loaded; ready to fade out splash screen
      19:095 onStopped: SplashScreen fade in animation finished
      19:096 onStarted: SplashScreen fade out animation started
      19:329 onStopped: SplashScreen fade out animation finished
      

      See the attached video.

      Note that the fade out animation looks like it runs correctly according to the logs, but is not visible on screen.

      I'm using an asynchronous loader because it seems like the right thing to do since loading the game is such a heavy operation, but I guess the animators should work ( ? ) regardless of whether or not the loader is asynchronous, since they themselves are in a separate thread.

      Attachments

        1. animator.wmv
          311 kB
        2. untitled1.zip
          3 kB

        Issue Links

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

          Activity

            People

              sletta Gunnar Sletta
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes