Basically what I did was to create a declarative engine and not a declarative view. By doing this you can have a QML file interpreted and access to the object instances created by the engine from within your C++ code. I see a lot of potential and possibilities, one thing that comes to my mind straight away is to utilize QML as a Dependency Injection container :)
QDeclarativeEngine *engine = new QDeclarativeEngine; QDeclarativeComponent component(engine, QUrl("qrc:/example1.qml")); Board *board = qobject_cast<board *>(component.create());
Example code to interpret a QML file
Check out the video below which demonstrates my code:
I've also tagged this post with Python because it can be of interest for the planet python readers since this can also be accomplished with PySide.