07-28-2012 07:09 AM
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
07-28-2012 10:57 AM
07-30-2012 01:59 AM
This tutorial may be what you are looking for. Check out the section "Using NavigationPane in C++". https://developer.blackberry.com/cascades/document
07-30-2012 07:19 AM
07-30-2012 08:33 AM
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);
}