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

LottieAnimation start() and stop() not work as expected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1: Critical P1: Critical
    • 6.5.1, 6.6.0
    • 5.15.1, 5.15.5
    • Lottie
    • None
    • 00d57fd85 (dev), 83c32c5d1 (6.5)

      LottieAnimation's start() and stop() don't work as expected.

       

      This is 100% reproducible.

      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtQuick.Controls 2.12
      import Qt.labs.lottieqt 1.0
      
      Window {
          width: 720
          height: 720
          visible: true
          title: qsTr("Hello World")
      
          Button {
              id: button1
              text: "Play"
              onClicked: {
      //            lottie.start()    // NOT WORK
      //            lottie.gotoAndPlay(lottie.startFrame) // NOT WORK
                  lottie.gotoAndPlay(2) // (sometimes gotoAndPlay(1) works, but not always)
              }
          }
      
          Button {
              anchors.left: button1.right
              text: "Stop"
              onClicked: {
      //            lottie.stop() // NOT WORK
                  lottie.gotoAndStop(lottie.endFrame)
              }
          }
      
          LottieAnimation {
              id: lottie
              anchors.centerIn: parent
              source: "qrc:/test01.json"
              autoPlay: false
      
              onStatusChanged: {
                  console.log("Status Changed:" + status)
                  if (status === LottieAnimation.Ready)
                      start() // WORK
              }
          }
      } 

      If we start() LottieAnimation in onStatusChanged(), it works okay.

      But if we control manually (in the example, I've started and stopped in the button)

      start() and stop() would not work.

      (gotoAndPlay(startFrame) not works as well)

       

       

        For Gerrit Dashboard: QTBUG-97259
        # Subject Branch Project Status CR V

            inho Inho Lee
            hyunkook_khang Hyunkook Khang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes