Search code examples
c++qmlblackberry-10blackberry-cascades

Design UI on QML or C++, BB10


I need to write a BB-10 app. The app might have quite involved UI, with dynamic pages etc. I am thinking to write the application logic (data models, etc.) in C++. Should I use QML for UI design? How well and flexible is integration between C++ and QML? Will I not encounter some problems? My UI may consist of many QML pages (or dialogs, shown in Navigation Panes etc.), and when user clicks some actions in QML I may want to invoke some C++ code or navigate to other QML pages etc. Thank you for help.


Solution

  • I do not know anything about mobile development, but QML is nice, should make interfaces easier to maintain, modify and port to other devices.

    Integration of QML and C++ is easy as long as you use well the Qt framework, using QObjects, Q_PROPERTY and Q_INVOKABLE methods... It is really easy.

    EDIT: I must add, though, that I did not find accessing QML objects from C++ as easy as the contrary. This is because QML organizes objects in a hierarchy of few data types, and you have to discover child nodes dynamically, using findChild or checking objectName.

    Anyway, since QML allows to bind properties, you should be able to create some C++ classes with your data, and access them on the UI without much effort ;)