Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
sanj1504
Posts: 108
Registered: ‎06-25-2013
My Device: Z10

Open a new qml page from another c++ function.

Hi,

I am developing an app which contain different features like camera, text editor, bar code scanner. All are placed as a button on main.qml page. When the user clicks on camera, camera should open . For this I had written a c++ function which has to take care of opening of a camera. I am able to call the c++ function from qml button click.

How to open a camera from the c++ function ??

Please use plain text.
Developer
yaolei
Posts: 19
Registered: ‎03-28-2013
My Device: www

Re: Open a new qml page from another c++ function.

Please use plain text.
Developer
sanj1504
Posts: 108
Registered: ‎06-25-2013
My Device: Z10

Re: Open a new qml page from another c++ function.

Here i have to open camera from the another c++ function.

 

ApplicationUI::ApplicationUI(bb::cascades::Application *app) : QObject(app){

QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);

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

AbstractPane *root = qml->createRootObject<AbstractPane>();

app->setScene(root);

}

 

void ApplicationUI::smileysurprised:penCamera () {

// here i need to open a camera to take picture

 

}

void ApplicationUI::readFile(std::string filename){

// here i will read a text file.

}

Please use plain text.