我是菜鸟,在学习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无用
悬赏问题
- ¥30 vmware exsi重置后的密码
- ¥15 易盾点选的cb参数怎么解啊
- ¥15 MATLAB运行显示错误,如何解决?
- ¥15 c++头文件不能识别CDialog
- ¥15 Excel发现不可读取的内容
- ¥15 UE5#if WITH_EDITOR导致打包的功能不可用
- ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
- ¥20 yolov5自定义Prune报错,如何解决?
- ¥15 电磁场的matlab仿真
- ¥15 mars2d在vue3中的引入问题