Integrating QML and C++ provides a variety of opportunities, including the ability to:
1. Separate the user interface code from the application logic code, by implementing the former with QML and JavaScript within QML documents, and the latter with C++
2. Use and invoke some C++ functionality from QML (for example, to invoke your application logic, use a data model implemented in C++, or call some functions in a third-party C++ library)
3. Access functionality in the Qt QML or Qt Quick C++ API (for example, to dynamically generate images using QQuickImageProvider)
4. Implement your own QML object types from C++ — whether for use within your own specific application, or for distribution to others
source: http://doc.qt.io/qt-5/qtqml-cppintegration-overview.html