Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
How I can change the button color while it's pressed?
Connect suitable slot to the clicked(bool) buttons signal.
clicked(bool)
void on_btn_clicked() { ui->btn->setStyleSheet("QPushButton{ background-color: yellow }"); } /*...*/ connect(ui->btn, SIGNAL(clicked(bool)), this,SLOT(on_btn_clicked())); //not tested
@mandruk1331
Hi,
yourButton->setStyleSheet("QPushButton:pressed { background-color: red }");