图标左文字右
方法一
QPushButton {
padding: 8px; //根据自己需求修改
text-align: right;
background-position: left;
background-image: url(:/icon.png);
background-repeat: repeat-no-repeat;
background-origin:content;
}
方法二
QPushButton {
text-align: left;
qproperty-icon: url(:/icon.png);
qproperty-iconSize: 24px 24px;
}
图标右文字左
QPushButton {
padding: 8px;
text-align: left;
background-position: right;
background-image: url(:/icon.png);
background-repeat: repeat-no-repeat;
background-origin:content;
}
图标上文字下
QPushButton {
padding: 5px;
min-height: 40px;
text-align: bottom;
background-position: top;
background-image: url(:/icon.png);
background-repeat: repeat-no-repeat;
background-origin:content;
}
图标下文字上
QPushButton {
padding: 5px;
min-height: 40px;
text-align: top;
background-position: bottom;
background-image: url(:/icon.png);
background-repeat: repeat-no-repeat;
background-origin:content;
}
网友评论