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
simon_hain
Posts: 16,139
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Determine type of an object in QML

In QML, i get a list (via QDeclarativeListProperty) of c++ elements that should be handled. These can be of different types:

A, B or a subclass of B (B1, B2, ... Bn)

 

I want to write custom QML components for each of these types and create them dynamically.

How do i determine of which type the object from my list is?

Or is that not possible, and i would have to declare a superclass that they all extend, with a type property?

 

 

 

----------------------------------------------------------
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.