Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-19 Thread Mario Zorz
Sure, didn't mean to offend anyone. I'm telling you though, in the context of Nickolas' question, it won't be possible to create a QML Button from within a WorkerScript, which is what I understand is what you suggested by pointing to that link. 2013/4/19 > Hi, Mario! > > > I know how to use wo

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-19 Thread mrqtros
Hi, Mario! I know how to use worker script, note that Nickolas asking in this "topic". I have qml experience about 2.5 years, so il's quite easy question for me =) 19.04.13 16:05 Mario Zorz написал(а): Hi Roman Please note you can't access QML objects from within a WorkerScript. See this (fr

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-19 Thread Mario Zorz
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

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-19 Thread Vladimir M.
Sort of :-) 19.04.2013 14:40 пользователь написал: > Funny, explored bug (issue) just by using a lot of components =) > > 19.04.13 14:16 Michael Zanetti написал(а): > FYI: After having a chat with the SDK people, it turns out that the Button > is > indeed slower than it should be. I've reported t

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-19 Thread mrqtros
Funny, explored bug (issue) just by using a lot of components =) 19.04.13 14:16 Michael Zanetti написал(а): FYI: After having a chat with the SDK people, it turns out that the Button is indeed slower than it should be. I've reported this bug: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/11

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-19 Thread Michael Zanetti
FYI: After having a chat with the SDK people, it turns out that the Button is indeed slower than it should be. I've reported this bug: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1170638 Br, Michael On Thursday 18 April 2013 20:05:59 Michael Zanetti wrote: > Wow, the slowness really comes

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-18 Thread Michael Zanetti
Wow, the slowness really comes from using the Button element from Ubuntu.Components. Inside GameButton.qml, replace Button {} with this: Image { id: button source: "closed.png" width: buttonHolder.width height: buttonHolder.height MouseArea {

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-18 Thread Michał Sawicz
W dniu 18.04.2013 19:05, Michał Sawicz pisze: >> https://bitbucket.org/nshatokhin/valves.git > 404 https://bitbucket.org/nshatokhin/valves Seems to work. -- Michał Sawicz Canonical Services Ltd. signature.asc Description: OpenPGP digital signature -- Mailing list: https://launchpad.net/~ubu

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-18 Thread Michał Sawicz
W dniu 18.04.2013 18:28, Николай Шатохин pisze: > https://bitbucket.org/nshatokhin/valves.git 404 > And how to connect signals to buttons created by Repeater? Usually: onClicked: someObject.someHandler(index) -- Michał Sawicz Canonical Services Ltd. signature.asc Description: OpenPGP di

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-18 Thread Николай Шатохин
This is my git repository: https://bitbucket.org/nshatokhin/valves.git And how to connect signals to buttons created by Repeater? 2013/4/18 Michael Zanetti > Doesn't look too bad... so the slowness must be either in the GameButton > itself or something connected to the the fieldCreated() sign

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-18 Thread Michael Zanetti
Doesn't look too bad... so the slowness must be either in the GameButton itself or something connected to the the fieldCreated() signal. Can you push the whole code to some repository? I would be willing to give it a shot and try to find out whats going wrong. On Thursday 18 April 2013 18:32:53

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-18 Thread Николай Шатохин
I did this: Grid { id: grid anchors.centerIn: parent rows: 4 columns: 4 spacing: __buttonRightMargin Repeater { id: buttons GameButton { row: index % __gameFieldWidth

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-16 Thread Николай Шатохин
Nope, but very similar by interface 2013/4/16 Roman Shchekin > MineSweeper? > > > 2013/4/16 Michael Zanetti > >> On Tuesday 16 April 2013 18:54:01 Michael Zanetti wrote: >> > As a rule of thumb, you should be able to write more than 90% of your >> > application without the need to the work "fu

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-16 Thread Roman Shchekin
MineSweeper? 2013/4/16 Michael Zanetti > On Tuesday 16 April 2013 18:54:01 Michael Zanetti wrote: > > As a rule of thumb, you should be able to write more than 90% of your > > application without the need to the work "function" (game logic > excluded). > > That should have been: ... without the

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-16 Thread Michael Zanetti
On Tuesday 16 April 2013 18:54:01 Michael Zanetti wrote: > As a rule of thumb, you should be able to write more than 90% of your > application without the need to the work "function" (game logic excluded). That should have been: ... without the need to use the word "function"... Regards, Michael

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-16 Thread Michael Zanetti
On Tuesday 16 April 2013 17:46:38 Николай Шатохин wrote: > So, I must use Repeater in new qml file and loading it by Loader, am I > right? Not necessarily... It really would be helpful to know what you are trying to achieve in order to give better advice. As a rule of thumb, you should be able t

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-16 Thread Николай Шатохин
So, I must use Repeater in new qml file and loading it by Loader, am I right? 2013/4/16 Rick Spencer > I suppose you would use a loader for the Repeater. After you make your > repeater work for your first level, you can use QtCreator to wrap the > Repeater in a loader for you. Then I think for

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-16 Thread Rick Spencer
I suppose you would use a loader for the Repeater. After you make your repeater work for your first level, you can use QtCreator to wrap the Repeater in a loader for you. Then I think for each level you would destroy the whole Repeater and then use the loader to create a new one with the new model

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-16 Thread Николай Шатохин
When I create button I assign destroy signal to each. So, when I start new game, I destroying buttons from old game and see old field in this moment - destroing slow too. Is quickly removing possible? Can I destroy repeater? 2013/4/16 Николай Шатохин > Oh, I didn't know that. I'll try. > > > 20

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-16 Thread Николай Шатохин
Oh, I didn't know that. I'll try. 2013/4/16 Rick Spencer > Hi. > > I'm not sure how your code flows overall, but if you are creating all the > buttons at once, you might consider using a Repeater instead of doing it > all in javascript. > > It looks like you might have some kind of list that fi

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-16 Thread Rick Spencer
Hi. I'm not sure how your code flows overall, but if you are creating all the buttons at once, you might consider using a Repeater instead of doing it all in javascript. It looks like you might have some kind of list that fires a createButton signal. You could potentially use that list as a model

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-16 Thread Vladimir M.
Hey, you'd wanna cache that component instance! :) Cheers from snoowy Russia On Tue, Apr 16, 2013 at 4:11 PM, Николай Шатохин wrote: > This is my code that creates buttons field: > > onCreateField: > { > for(var i=0;i { > for(var j=0;j { > createButton(i, j);

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-16 Thread Николай Шатохин
This is my code that creates buttons field: onCreateField: { for(var i=0;i > Can we see some code? The only time Images hang for me in QML is when it's > trying to load them synchronously. Try setting asynchronous to true. > > Cheers, > Alex > > On Tue, Apr 16, 2013 at 10:20 AM, wrote: > >>

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-16 Thread Alex Tyler
Can we see some code? The only time Images hang for me in QML is when it's trying to load them synchronously. Try setting asynchronous to true. Cheers, Alex On Tue, Apr 16, 2013 at 10:20 AM, wrote: > I thought Nick creates 1024 (16x16) buttons, lol =) And even did not > thought - for what :D >

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-16 Thread mrqtros
I thought Nick creates 1024 (16x16) buttons, lol =) And even did not thought - for what :D Of course code is extremely bad, if buttons with size 16x16 pixels creating slowly. 16.04.13 12:09 Michael Zanetti написал(а): On Tuesday 16 April 2013 01:01:28 Николай Шатохин wrote: > Hello. > > In my

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-16 Thread Michael Zanetti
On Tuesday 16 April 2013 01:01:28 Николай Шатохин wrote: > 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 > p

Re: [Ubuntu-phone] Running QML functions in parallel thread

2013-04-15 Thread Roman Shchekin
Hi, Nick. Look at WorkerScript, http://harmattan-dev.nokia.com/docs/library/html/qt4/qml-workerscript.html Best wishes, Roman. 2013/4/16 Николай Шатохин > Hello. > > In my code I'm creating 16x16 buttons in cycle and this take few seconds. > While function that creating buttons runs, app free

[Ubuntu-phone] Running QML functions in parallel thread

2013-04-15 Thread Николай Шатохин
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 lis