This is my first post on this forum , just started the BB 10 development and also C ++ as I am a Java Person. I am having some problem in QML and C++ intergration
Here what I am trying to do:
I have login page , on login button click my new page (which is a navigation pane ) gets open without any issue here is the method I use
void Integration:penNextPage() {
printLog("-- open second page (a navigation pane ");
new SecondPageHndlr (appRefrence);
}
Here is what I am doing in SecondPageHndlr class :
SecondPageHndlr.cpp
#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 kindly see the code and tell me what em doing wrong