Important: Please read the Qt Code of Conduct -

How to create delay function in javascript to be used in QML application?

  • I would like to create a delay function in javascript that takes a parameter of amount of time to delay, so that I could use it do introduce delay between execution of javascript lines in my QML application. The javascript lines I am talking about would trigger animation of some QML components(actually I am trying to sort some tiles based on their heights). It would perhaps look like this:

    @function delay(delayTime) {
    // code to create delay
    I need the body of the function delay(), please. Thanks in advance.

  • Use the Timer element.

Log in to reply