OK. Quick question: When I click on my button it goes from red to green, however, when I want to turn the button off, it does not turn back to red. Does anyone have any suggestions.
button->setChecked(true);
button
->setStyleSheet
(QString("QPushButton {background-color: red;}"));
connect(button,SIGNAL(pressed()),this,SLOT(onoff()));
void Dialog::onoff()
{
button->setChecked(false);
button
->setStyleSheet
(QString("QPushButton {background-color: green;}"));
*
*
button->setChecked(true);
button->setStyleSheet(QString("QPushButton {background-color: red;}"));
connect(button,SIGNAL(pressed()),this,SLOT(onoff()));
void Dialog::onoff()
{
button->setChecked(false);
button->setStyleSheet(QString("QPushButton {background-color: green;}"));
*
*
To copy to clipboard, switch view to plain text mode
Bookmarks