Code:
#include "SecondPageHndlr.hpp"
#include "ThirdPageHndlr.hpp"
#include <bb/cascades/Application>
#include <bb/cascades/QmlDocument>
#include <bb/cascades/AbstractPane>
#include <bb/cascades/NavigationPane>
#include <bb/cascades/Page>
#include <bb/cascades/Sheet>
#include <QObject>
#include <QIODevice>
#include <iostream.h>
#include <string.h>
#include <stdio.h>
using namespace bb::cascades;
SecondPageHndlr::SecondPageHndlr(bb::cascades::Application *app)
: QObject(app){
try{
QmlDocument *secondQml = QmlDocument::create("asset:///SecondPage.qml");
if (!secondQml->hasErrors()) {
NavigationPane* page = secondQml->createRootObject<NavigationPane>();
if (page)
{
printLog("second page view . page is not null ");
//make this c++ file accessable from the dashboardviewn.qml
pane = page;
secondQml->setContextProperty("second", this );
app->setScene(page);
}
else
printLog("page is null ");
}
else
printLog("Error in second page view QML");
}
catch (std::exception& e)
{
printLog("-------- Exception");
std::cout << "Exception: " << e.what();
}
}
void SecondPageHndlr::showThirdScreen(){
printLog("-- open Third page (a navigation pane pushes a new page");
new ThirdPageHndlr (pane);
}
void SecondPageHndlr::printLog(const char *str){
cout <<"\n" << str ;
printf("" ,1);
fflush(stdout);
}
Now when from this second screen I try to open the third page it would not work at all