我是菜鸟,在学习qml, 请问qml中,怎么给Button按钮设置一个背景图片?
2条回答 默认 最新
- qtchen_1988 2019-07-22 17:48关注
//第一种 Button { y: root.height - height width: 100 height: 30 Image{ anchors.fill: parent source: "qrc:///board_2.png" } text: "Click me" onClicked: { root.btnsig_handling(); } } //第二种 Button { y: root.height - height width: 100 height: 30 text: "Click me" iconSource: "qrc:///board_2.png" onClicked: { root.btnsig_handling(); } }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 1无用