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
New Developer
Posts: 60
Registered: ‎12-20-2010
My Device: Black Berry Bold 9900

Problems returning/getting values from classes to QML (or calling child functions from classes)

Hi everyone,

 

I'm trying to pass values back to the QML (from a C++ function), but I'm seriously having troubles figuring it out.

 

Is it only possible by using the signals or is there an other way?

 

And my second problem is getting/calling nested object instances to the QML.

 

I registered the objects at the main.cpp, so I can use them seperately, but I want like this:

 

- Three classes A, B and C have been defined. Class A had a QVector containing x B classes. B class has a C class as a child.

 

I want to call the getBClasses function from the A class and then call a function from the C class, like this:

 

classA.getBClass(0).classC.function()

 

The only way to I get this done now from my QML is calling them one by one and passing the values one by one.

 

Get class A object

Get class B object from A

Get class C object from B

Call function from C

 

Could someone give me some inspiration/advice on these two subjects? Looked around on the internet for a while, but didn't see any solutions for this.

 

Thanks in advanced :smileyhappy:

BlackBerry World submissions

YahtC - http://appworld.blackberry.com/webstore/content/24150872 - Check it out!

Free Yahtzee game for you and your friends! Step up to the challenge and see who is the Yahtzee-champion!

Leave a review, thanks!