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

ScriptAction duration should not be 0

    XMLWordPrintable

Details

    Description

      This can cause animation jumps with expensive scripts, e.g. in the following example the second move doesn't animate.

      import Qt 4.7
      
      Rectangle {
          width: 400
          height: 200
      
          function pausecomp(millis)
          {
              var date = new Date();
              var curDate = null;
      
              do { curDate = new Date(); }
              while(curDate-date < millis);
          }
      
          Rectangle {
              width: 50; height: 50
              color: "blue"
              SequentialAnimation on x {
                  NumberAnimation { to: 200 }
                  ScriptAction { script: pausecomp(1000) }
                  NumberAnimation { to: 400 }
              }
          }
      }
      

      One alternative is to make the duration -1, and notify when the action has finished. (we should try to measure the performance cost of this)

      Attachments

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

        Activity

          People

            brasser Michael Brasser (closed Nokia identity) (Inactive)
            brasser Michael Brasser (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes