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

Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
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 Smiley Happy
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
Regular Contributor
Posts: 70
Registered: ‎09-06-2012
My Device: Developer
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?



Posts: 160
Registered: ‎01-27-2012
My Device: Playbook
My Carrier: Rogers

Re: Find a dynamically created element from c++

Reading through this:



I think the difference is when you:



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"