1

I need to show line,bar and candle charts in BB10 cascades. I have all 3 java script files, but I need to pass data to those script file through c++ code. How can I do that in BB10 cascades.?

Please Help.

Thanks in advance.

user2085965
  • 393
  • 2
  • 13
  • 33

1 Answers1

2

Put this in your .cpp file in main

qml->setContextProperty("app", this);

then somewhere else in cpp

QString ApplicationUI::myFunction() {
    return "my data";
}

and you call it from QML like this (put this in onCreationCompleted):

var data = app.myFunction();

Make sure that function is Q_INVOKABLE in .hpp file!

A little documentation on this: C++ and QML integration

Bojan Kogoj
  • 5,321
  • 3
  • 35
  • 57