After poking around some more, I think the error message may be referring to the vert[i] object as being undefined, not the value I'm trying to feed it.
But my vert object works otherwise, and I can change the color on it using similar syntax, so it should be valid. Also, when I do a typeof(vert[i]), I get something along the lines of Vertex_QMLTYPE_3(0x6000003b82a0)
I get the same thing if I say console.log(vert[i]). That suggests to me that my object is valid.
The verts are created dynamically, and they are created from the following .qml file, using these commands:
var component = Qt.createComponent("Vertex.qml");
var vertex = component.createObject(parent, {x: xPos, y: yPos, width: size, color:"yellow"});
import QtQuick
Rectangle {
width: 8
height: 8
color: yellow
property string tag: ""
MouseArea {
anchors.fill: parent
drag.target: undefined
drag.smoothed: false
onReleased: {
polyCanvas.requestPaint()
}
}
}
Please let me know if you've got something...
bc