Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
Posts: 26
Registered: ‎11-10-2013
My Device: Z10

loading a scene inside a separate function

 

 

If I am using QML, I can load the document to c++, and then create the root context, and then set the scene.Now when I move from that screen to another screen(by calling

Application::instance()->setScene(newroot)

 inside a separate function) what happens to the old scene? does it get removed from the memory?

now if i have to load the old scene back, do I have to load the qml doc again, and set the scene once more?

 

And also if the above is done by c++ in separate functions, Do i have to call each functions again and again for each time I show that screen?

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: loading a scene inside a separate function

Unless you changed the previous 'scenes' parent to something else then it will be deleted automatically on calling the setScene() funciton.

 

If you do want to keep it then before calling this function change the parent to something else. You will then be responsible for keeping track of the object yourself, deleting on exit or when no longer needed. If your intention is to have the user switch between th two at will then obviously you will need logic to keep track of which one will be auto deleted and which one you will need to delete yourself.

 

http://developer.blackberry.com/native/reference/cascades/bb__cascades__application.html#function-se...


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Contributor
Posts: 26
Registered: ‎11-10-2013
My Device: Z10

Re: loading a scene inside a separate function

what do you mean by "change the parent to something else"?  How do I implement what you are saying.

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: loading a scene inside a separate function

Okay, I mean no offence by this but your knowledge seems slightly limited, so before I go down the root of answering this question could you let me know what you are trying to do?

Have you looked at tabbedPane or navigationPane for instance which give a much more natural and complex-free way of switching qml pages?

If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.