从 javascript 使用创建对象后:
function createNextItem(item, where) {
component = Qt.createComponent(val);
sprite = component.createObject(where, {
"id": "currentitem",
"anchors.left": nextlabel.right,
"anchors.leftMargin": units.gu(4),
"anchors.verticalCenter": nextlabel.verticalCenter
});
if (sprite === null) {
// Error Handling
console.log("Error creating object");
}
}
如果我尝试添加"transform": Scale { xScale: 0.5 ; yScale: 0.5}
我得到一个SyntaxError: Unexpected token {
但如果我做这样的事情"transform": "Scale { xScale: 0.5 ; yScale: 0.5}"
,它不起作用......有什么帮助吗?