Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

How to queue the invocation of a slot instead of calling directly ?

$
0
0
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()

Viewing all articles
Browse latest Browse all 4972

Trending Articles