Friends help me, how does it do to execute a qml function from an Item inside a Parallel Thread to not freeze UI? help please
-
Friends help me, how does it do to execute a qml function from an Item inside a Parallel Thread to not freeze UI?
example:
Import QtQuick 2.7
MyItem {
Function foo () { // script For (var i = 0; i <1000000; i ++) { Console.log ( "Number:" + i) } } // end function
} // end MyItem
-
Hi! See WorkerScript QML Type.
-
More in Work Script I can not work with objects within a function. Is there any way for this?
-
More in Work Script I can not work with objects within a function. Is there any way for this?
MyItem {
function foo () {
// script anotherObj.foo()
} // end function
} // end MyItem
-
No, more isn't possible because JS is single-threaded by design. These worker scripts (or web workers in other contexts) are more or less just a hackish work-around for that. Keep in mind that JS is meant only for very short / simple code. Executing it is very inefficient, so you should really do all the complicated non-GUI stuff in C++.
-
So how do I call a function from an object without freezing my UI?
-
@Everton-Fonseca C++ and QRunnable