In my C++ program, I want to be able to load a file at runtime which contains the data for several employees (first name, last name, DOB). This file should be interpreted and Employee objects created for each employee, and stored in some sort of list (maybe QList?).
On the QML side of things, I have an 'employee.qml' file which is essentially a rectangle with a few text fields in it.
As my Employee objects are created, I also want to create instances of my 'employee.qml' component, and bind each one to its respective Employee object, such that the text field reflects the data in the C++ object.
Effectively, for each Employee object, a new component should be placed on the screen, and be bound to the correct object. It should also be able to call public slots methods defined in the class.
Is this even possible with Qt and QML?
EDIT:
One possible idea might be to use QQmlComponent::create() in C++, set the id to the name of the C++ object using SetProperty(), and use setContextProperty to make the object available to QML.