← Back to team overview

ubuntu-phone team mailing list archive

Re: Running QML functions in parallel thread

 

Hi Roman

Please note you can't access QML objects from within a WorkerScript. See
this (from the same link you posted):

Restrictions
> Since the WorkerScript.onMessage() function is run in a separate thread,
> the JavaScript file is evaluated in a context separate from the main QML
> engine. This means that unlike an ordinary JavaScript file that is imported
> into QML, the script.js in the above example cannot access the
> properties, methods or other attributes of the QML item, nor can it access
> any context properties set on the QML object throughQDeclarativeContext<http://harmattan-dev.nokia.com/docs/library/html/qt4/qdeclarativecontext.html>
> .


Best,
Mario

2013/4/15 Roman Shchekin <mrqtros@xxxxxxxxx>

> Hi, Nick.
>
> Look at WorkerScript,
> http://harmattan-dev.nokia.com/docs/library/html/qt4/qml-workerscript.html
>
> Best wishes,
> Roman.
>
>
> 2013/4/16 Николай Шатохин <n.shatokhin@xxxxxxxxx>
>
>> Hello.
>>
>> In my code I'm creating 16x16 buttons in cycle and this take few seconds.
>> While function that creating buttons runs, app freezes. I want to show
>> loading animation while this function runs. So, how to run this function in
>> parallel thread to avoid freezing?
>>
>> Best regards,
>> Nick
>>
>> --
>> Mailing list: https://launchpad.net/~ubuntu-phone
>> Post to     : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~ubuntu-phone
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
> --
> Mailing list: https://launchpad.net/~ubuntu-phone
> Post to     : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ubuntu-phone
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References