Hi everyone! how to add qml widget in QGraphicsScene version QtQuick 2.0? In The documentation only found out how to add widgets version QtQuick 1.0, and version QtQuick 2.0 no.
QGraphicsScene* scene = myExistingGraphicsScene();
QDeclarativeEngine *engine = new QDeclarativeEngine;
QDeclarativeComponent component(engine, QUrl::fromLocalFile("myqml.qml"));
QGraphicsObject *object =
qobject_cast<QGraphicsObject *>(component.create());
scene->addItem(object);
↧