Qt通过qss设置按钮图标样式

closeButton = new QPushButton();
	
closeButton->setStyleSheet("QPushButton{image:url(:/xx/Resources/blackclose.png);background-color:transparent;}"
		"QPushButton:hover{image:url(:/xx/Resources/blueclose.png)}"
		"QPushButton:pressed{image:url(:/xx/Resources/blueclose.png)}");

 

    原文作者:王云霖
    原文地址: https://blog.csdn.net/ihatetheworld7/article/details/104512595
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞