I am wondering if anyone can assist me in changing the color of a button upon it being on and and off. so for example - when it is on its green however when it is off it is red.
I think in the older version of qt the QPushButton isOn assisted in this.
I have proved an example:
if (button->isDown())
button->setStyleSheet(QString("QPushButton {background-color: green;}"));
else
button->setStyleSheet(QString("QPushButton {background-color: red;}"));
}
Bookmarks