图片居左
// 默认图片居左ui->pushButton->setIcon(QIcon(":/choose_fold.png"));// 这个是图片居右,但效果不好ui->pushButton->setLayoutDirection(Qt::RightToLeft);
效果(忽略除图片的其它样式)
QPushButton {text-align: left; /*文字居左*/border-radius: 14px;border: 1px solid rgb(208, 211, 211);color: rgba(0, 0, 0, 255);background-color: rgb(241, 244, 244);}QPushButton:hover {color: rgba(74, 147, 253);background-color: rgb(241, 244, 244);}QPushButton:pressed, QPushButton:checked {color: rgb(74, 147, 253);background-color: rgb(219, 239, 253);}
