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
likian
Posts: 30
Registered: ‎01-28-2014
My Device: BlackBerry Z10
My Carrier: Swisscom

Active Frame in QML

Hi there!

 

I had a look at this web page: http://developer.blackberry.com/native/documentation/cascades/ui/active_frames/index.html and then I created to cover with a QML file. How can I set this QML file as the active frame (in QML)?

 

Thank you for your answer!

likian

Please use plain text.
Developer
BBSJdev
Posts: 6,098
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Active Frame in QML

The code is there in the link you gave, what is it you are having problems with?


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
likian
Posts: 30
Registered: ‎01-28-2014
My Device: BlackBerry Z10
My Carrier: Swisscom

Re: Active Frame in QML

Is it this one:

 

QmlDocument *qmlCover = QmlDocument::create("asset:///AppCover.qml").parent(
        this);
 
if (!qmlCover->hasErrors()) {
    // Create the QML Container from using the QMLDocument.
    Container *coverContainer = qmlCover->createRootObject<Container>();
 
    // Create a SceneCover and set the application cover
    SceneCover *sceneCover = SceneCover::create().content(coverContainer);
    Application::instance()->setCover(sceneCover);
}

 

Where do I have to enter this code? (sorry, but I'm a real beginner)

Please use plain text.
Developer
BBSJdev
Posts: 6,098
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Active Frame in QML

It needs to go in applicationui.cpp in the constructor.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
BBSJdev
Posts: 6,098
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Active Frame in QML

If you get stuck download the cookbook sample and take a look at the code, this sample both the C++ and QML version are also good to look at for a beginner as it has simple code that covers a lot of the ideas behind cascades and BB10 apps..

 

http://developer.blackberry.com/native/sampleapps/

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.