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
Highlighted
Developer
Posts: 21
Registered: ‎04-26-2012
My Device: BlackBerry 9800
My Carrier: BlackBerry

How to use Navigation pane in CPP

Hi,

 

I have two screens,

screenOne having simple button(main.qml)

screenTwo haveing Image.(image.qml)

 

I did this in Qml, but i want to do in c++ using abow two qml screens

 

if you provide an example project it will very helpfull for me.

 

Thank you

New Developer
Posts: 6
Registered: ‎05-29-2010
My Device: bold9000
My Carrier: cm

Re: How to use Navigation pane in CPP

I also want to know this.
how to do something between the qml files and cpp files.
Developer
Posts: 18
Registered: ‎04-28-2012
My Device: Playbook & Dev Alpha
My Carrier: AIS

Re: How to use Navigation pane in CPP

This tutorial may be what you are looking for. Check out the section "Using NavigationPane in C++". https://developer.blackberry.com/cascades/documentation/ui/navigation/multiple_screens_stack.html

Developer
Posts: 21
Registered: ‎04-26-2012
My Device: BlackBerry 9800
My Carrier: BlackBerry

Re: How to use Navigation pane in CPP

Thank you for replay, but the tutorial about creating navigation pane in QML or C++, but i want use the navigation in c++ using QML pages.
Developer
Posts: 18
Registered: ‎04-28-2012
My Device: Playbook & Dev Alpha
My Carrier: AIS

Re: How to use Navigation pane in CPP

Sorry, I misunderstood your question. I do something like this to load a qml file into C++.

 

// main.qml

import bb.cascades 1.0

NavigationPane {
    signal button1Clicked()

    Page {
        Button {
            text: "Button 1"
            onClicked: button1Clicked()
        }
    }
}

 

 

class App : public QObject {
...

public slots:
    void onButton1Clicked();

private:
    NavigationPane *mNav;
...
}

void App::App()
{
    QmlDocument *qml = QmlDocument::create("main.qml");
    mNav = qml->createRootNode<NavigationPane>();

    connect(mNav, SIGNAL(button1Clicked()), this, SLOT(onButton1Clicked()));

    Application::setScene(mNav);
}

void App::onButton1Clicked()
{
    QmlDocument *qml = QmlDocument::create("page2.qml");
    Page *page = qml->createRootNode<Page>();

    mNav->push(page);
}