I got the following code from http://apidocs.meego.com/1.2/qt4/qtbinding.html (and many other places):
// Using QDeclarativeView
QDeclarativeView view;
view.setSource(QUrl::fromLocalFile("MyItem.qml"));
view.show();
QObject *object = view.rootObject();
Unfortunately it doesn't compile. I get this error message:
cannot convert 'QGraphicsObject*' to 'QObject*' in initialization
It looks like we're trying to cast a QGraphicsObject to a QObject. What is going on here?
Thanks in advance.
Bookmarks