[SailfishDevel] Refrence dynamically created QML object?

Peter Pykäläinen peter.pykalainen at gmail.com
Mon Oct 6 08:04:42 UTC 2014


Thanks Andrey!
Will test that too tonight.


// Peter Pykäläinen

On 6 October 2014 10:39, Andrey Kozhevnikov <coderusinbox at gmail.com> wrote:

>  use
>
> property Item object1
> property Item object2
>
> ...
>
> function createObjects() {
>      object1 = component1.createObject(parent, paraneters)
>      object2 = component2.createObject(parent, paraneters)
>     checkCollisionsFunction(object1, object2)
> }
>
> 06.10.2014 12:26, Peter Pykäläinen пишет:
>
>     Hi,
>
>  I have a problem with a dynamically created QML object and referencing it.
>  The problem is as follows:
>
>  - Create a dynamic QML object with createObject, assign signal to it.
> This works fine.
>  - Create another dynamic QML object.
>  - I would need to check collision of these two new objects, I am using a
> timer to check that.
>  - Now since I can not reference both objects with their IDs I can't get
> the collision check to work.
>
>  Any ideas how to achive this?
>
>  I have tried to use a LlistModel to store all my objects, but looping
> through them with JavaScript slows down my application significantly, so
> this is not an option.
>
> // Peter Pykäläinen
>
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org
>
>
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to
> devel-unsubscribe at lists.sailfishos.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20141006/447baf46/attachment.html>


More information about the Devel mailing list