Not directly. There was a WIP patch to add Qt.later() and Qt.after() functions to the Qt global object, to allow this use-case, but it couldn’t handle the case where the context got deleted out from underneath it gracefully.
The closest you can do is create a Timer object with a timeout of 1 millisecond (actually, 0 might work, not sure), and invoke the function in the onTriggered / onTimeout or whatever it’s called, handler.
Timer {
id: fnQueue
property var queuedFunction
interval: 1
onTriggered: { queuedFunction.call() }
}
// some imperative code...
fnQueue.queuedFunction = someFunc;
fnQueue.start()
↧