1

I´ve created a Blackberry 10 project with Cascades. Now I´ve to populate the main view with some WebViews and setup the event listeners between the WebView and the applicationui.cpp file.

Right now I´ve added just one WebView to the main view and added some of the properties I need.

//applicationui.cpp
// ApplicationUI::ApplicationUI()

QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
qml->setContextProperty("injection", this);

Page* root = new Page;
WebView* master = WebView::create();
WebView* login = WebView::create();

master->setProperty("visible", false);

login->setProperty("preferredHeight","1280");
login->setProperty("preferredWidth","768");
login->setProperty("maxHeight","1280");
login->setProperty("maxWidth","768");
login->setProperty("minHeight","720");
login->setProperty("minWidth","720");
login->setProperty("url", "https://www.google.com");

root->setContent(master);
root->setContent(login);
Application::instance()->setScene(root);

When I declare the WebView object on the Qml file, I can access some listeners like, onLoadingChanged but I would want to access those listeners from the .cpp file so I can build them on the run.

Is there a way to achieve this?

Help would be appreciated.

Thanks in advance :)

reixa
  • 6,903
  • 6
  • 49
  • 68

0 Answers0