How to set icon at different modes?
-
You should create QIcon object and set additional pixmap for QIcon::Mode==Disabled
-
You can use style sheet:
@
QPushButton {
border-image: url(:/images/bouton-retour.png);
background-color: rgba(255, 255, 255, 0);
}QPushButton::pressed,QPushButton:disabled {
border-image: url(:/images/bouton-retour-desactive.png);
}
@[edit: fixed code / chetankjain]
-
cheng, border-image is not exactly what needed for author. It will fill borders, but not change icon.