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
Developer
babakar
Posts: 770
Registered: ‎05-29-2012
My Device: see later
Accepted Solution

Unable to find navigation pane

static NavigationPane* myNavi2;
ApplicationUI::ApplicationUI() :
                                QObject() {

    QMetaObject::invokeMethod(this, "init", Qt::QueuedConnection);
myNavi2 = new NavigationPane;
}


void ApplicationUI::help() { qDebug() << "help"; try { QmlDocument *qml = QmlDocument::create("asset:///Help.qml").parent(this); // Create root object for the UI // AbstractPane *root = qml->createRootObject<AbstractPane>(); Page *new_Page = qml->createRootObject<Page>(); // AbstractPane *oldScene = Application::instance()->scene(); // myNavi = oldScene->findChild<NavigationPane*>("guestMenuNavigation"); myNavi2 = root->findChild<NavigationPane*>("guestMenuNavigation"); if (myNavi2){ myNavi2->push(new_Page); Application::instance()->setScene(myNavi2); }else{ qDebug() << "Unable find NavigationPane"; } } catch(...) { } }

 

qml opened

 

NavigationPane {
    id: guestMenuNavigation
    objectName: "guestMenuNavigation"
    onPopTransitionEnded: {
        page.destroy();
    }
Page {
    

 

Developer
babakar
Posts: 770
Registered: ‎05-29-2012
My Device: see later

Re: Unable to find navigation pane

if I do thisit works

 

 myNavi2 = dynamic_cast<NavigationPane*>(root);;