在我的项目中,我设法使用组件填充网格布局中的一些按钮 . 但是我无法在按钮中添加样式组件 . 这是我的代码:
Component {
id: itemgroup
Button { }
}
function addButton () {
for(var i = 0 ; i < 10 ; i++) {
var button = itemgroup.createObject (gridX, {
"id": "btnitemgroup",
"style": buttonstyle,
"text" :"hai"
});
}
}
1 回答