Change color while the button is pressed
-
wrote on 31 Jan 2016, 10:20 last edited by
How I can change the button color while it's pressed?
-
wrote on 31 Jan 2016, 10:44 last edited by
Connect suitable slot to the
clicked(bool)
buttons signal.void on_btn_clicked() { ui->btn->setStyleSheet("QPushButton{ background-color: yellow }"); } /*...*/ connect(ui->btn, SIGNAL(clicked(bool)), this,SLOT(on_btn_clicked())); //not tested
-
How I can change the button color while it's pressed?
wrote on 31 Jan 2016, 12:05 last edited by
3/3