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
gdev001
Posts: 163
Registered: ‎01-30-2013
My Device: Blackberry 10 Simulator

Re: Using C++ classes in QML

Thanks you are my hero :smileyhappy:)). So basically it is possible to pass data from and to C++ and QML right? including arrays etc. I will need this as the application I am going to build might require complex user interaction, e.g., getting data from internet, showing it on UI, responding to user clicks etc.
Please use plain text.
Developer
dishooom
Posts: 103
Registered: ‎12-31-2012
My Device: Blackberry 9810
My Carrier: Verizon

Re: Using C++ classes in QML

Yup... you could do every possible stuff of that sort with QML and CPP....  May be you could take a quick glance at QvariantLists and other QT primitives, before diving deep.... :Angel:

 

 

 

Please use plain text.
Developer
gdev001
Posts: 163
Registered: ‎01-30-2013
My Device: Blackberry 10 Simulator

Re: Using C++ classes in QML

[ Edited ]

Yes that's true thanks. Because I might need to pass for example array of objects to QML in order to display them etc...

As I understood there are two options: either to do all UI using C++ or do it using QML; so far I think I am more opting for combining the two; as QML seems more faster, although I am more familiar with C++

Please use plain text.
Developer
dishooom
Posts: 103
Registered: ‎12-31-2012
My Device: Blackberry 9810
My Carrier: Verizon

Re: Using C++ classes in QML

May be you could read So, when should I use QML and when should I use C++? in the Fundamentals of Cascades

 

_ Dishooom

 

Hope this helps :Angel:

Please use plain text.
Developer
oliver_kranz
Posts: 216
Registered: ‎09-18-2009
My Device: Z10
My Carrier: O2

Re: Using C++ classes in QML

Nice to hear it's solved :-)

 

You are right. That's also the difference in my code.

 

qmlRegisterType<QTimer>("my.library", 1, 0, "QTimer");

 This line was called before the other code.

Please use plain text.
Developer
gdev001
Posts: 163
Registered: ‎01-30-2013
My Device: Blackberry 10 Simulator

Re: Using C++ classes in QML

Thanks. That's exactly how I was planning to do it. Use QML for User interface, and C++ for functionality (e.g., data storage, retrieving data from internet etc.). Another option is to do all in C++ but if I learn to use and combine C++ and QML as mentioned in my threads, I think it should be ok ....
Please use plain text.