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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Developer
simon_hain
Posts: 13,790
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Find a dynamically created element from c++

that looks like quite a hack, create the page dynamically, hand a reference to the c++ and use findChild on this reference.

I begin to understand why Paul suggests to solve it some other way :smileyhappy:
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Regular Contributor
pskarton
Posts: 70
Registered: ‎09-06-2012
My Carrier: Bell Mobility

Re: Find a dynamically created element from c++

The context property for _locationDiagnostics is set in main.cpp and refrenced in main.qml.

 

The documentation says to import the context. Why does this work without the import?

 

It certainly doesn't work for me with the import because it tries to find the import before the context is created.

 

So when is the import required and when is it not required?

 

 

Please use plain text.
Developer
Dredvard
Posts: 154
Registered: ‎01-27-2012
My Carrier: Rogers

Re: Find a dynamically created element from c++

Reading through this:

https://developer.blackberry.com/cascades/documentation/dev/integrating_cpp_qml/index.html

 

I think the difference is when you:

qmlRegisterType

 

you need to import.  If you setContextProperty of a qml - you don't for it or it's children.

 

---
If you find my post helpful please "like" it and "accept as a solution"
Please use plain text.