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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Developer
Pallam_Madhukar
Posts: 21
Registered: ‎04-26-2012
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

Please use plain text.
New Developer
qingchen191
Posts: 6
Registered: ‎05-29-2010
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.
Please use plain text.
Contributor
iamjay
Posts: 18
Registered: ‎04-28-2012
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

Please use plain text.
Developer
Pallam_Madhukar
Posts: 21
Registered: ‎04-26-2012
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.
Please use plain text.
Contributor
iamjay
Posts: 18
Registered: ‎04-28-2012
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);
}

 

 

Please use plain text.