qt - Invalid grouped property access -


in qml code:

component {         id: userdelegate   picturebox {     ...     icon: model.icon     icon.heigth: 50   } } 

picturebox comes picturebox.qml system file in way:

... image {   id: icon   ...   width: parent.width; height: 150 } 

running qml, have error in title. need use picturebox.qml, can't change it. how can override default height value picturebox.qml icon?

you can try bypass qml's scoping rules traversing item children until can find image , manipulate directly. it's possible break in future, item.tostring() gives useful:

item.tostring() -> "qquickimage(0x114054350)" 

so, can try (not tested):

function finditemoftype(type, item) {     if (item.tostring().indexof(type) != -1) {         return child;     }     (var i=0;i < children.length;++i) {         var child = children[i];         var result = finditemoftype(type, child.children);         if (result != null) {             return result;         }     }     return null; } 

using this:

finditemoftype("qquickimage", pictureboxid); 

Comments