The object is to display Data in QML
I created a new QML file code above , I would like to communicate C++ class and This QML file, so I tried to use :
QQuickView *view= new QQuickView;
QQmlContext *c = view->engine()->rootContext();
c
->setContextProperty
("myModel",
QVariant::fromValue(projects
));
QQuickView *view= new QQuickView;
QQmlContext *c = view->engine()->rootContext();
c->setContextProperty("myModel", QVariant::fromValue(projects));
To copy to clipboard, switch view to plain text mode
Is this an other way simple to do that ??
Bookmarks