if you look at my sample below I can alter the properties of QML objects from my C++ code using QT.
C++
QQuickItem* objectimage = quickView->rootObject();
QObject *im = objectimage->findChild<QObject*>("rect");
im->setProperty("color", "red");
QML
Image {
objectName: "ima"
id:pic
source: "bgnight.png"
Rectangle{
objectName: "rect"
id:redRect1
width: 100
height: 100
x: 130
y:230
color:"transparent"
My question is how do you change the source of an image in the same way from C. I would like to change the background image of QML from C++.
Image
{
property string src: "bge.png"
source: src
objectName: "ima"
id:pic
}