I found out after repeated search and experimentation;)
void ArticleParser::addImage(QString imageUrl, QString title) {
QmlDocument *document = QmlDocument::create(
"asset:///Articles/ArticleImage.qml");
document->setParent(rootContainer);
if (!document->hasErrors()) {
Control *control = document->createRootObject<Control>();
control->setProperty("source", imageUrl);
control->setProperty("caption", title);
rootContainer->add(control);
}
}
The above method is called from within C ++ to add images using my custom image control (which supports http-url), so it can be added dynamically.
source
share