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

Posts: 15
Registered: ‎07-15-2013
My Device: Blackberry Z10
My Carrier: Verizon

Questions about swapping Page, NavigationPane objects out of Tab objects and the general lifecycle of these objects and their corresponding QmlDocuments

Hey guys,


I've been developing for Blackberry for a few weeks, so I'm still pretty new at it. I'm coming from a background of a about a year of Android dev experience if that helps.


I have some questions regarding if I'm using accepted practices as far as swapping out content on my tabs. According to the design I was given, I have tabs that are selected through the action menu, and I only display the current tab on the action bar. The rest of the bar is filled with action items.


When you click the action items I want to swap out content in the Tab object's area. I'm starting out with some logic like this: 


QString qmlResourcePath = "asset:///layout/meeting_tabs/room_tab/room_page.qml";

QmlDocument * qml = QmlDocument::create(qmlResourcePath);

AbstractPane * oldPane = currentPane;

currentPane = qml->createRootObject<AbstractPane>();


delete oldPane;


Is this an acceptable way of doing this? Is there a better way? Is the QmlDocument object automatically deleted with the pane or do I need to explicilty delete it.


I use AbstractPane because I'm going to need to set both NavigationPane and Page objects as the tab content.