1 Attachment(s)
How to change push button text by clicking on another push button
I added 2 Push buttons in ui like this Attachment 13398
i added a slot for button "CLICK",
Code:
void MainWindow::on_pushButton_clicked()
{
}
when i click on this button "CLICK" i want the button's "BUTTON" text to be changed to "CLICKED".
How can i do that ?
Re: How to change push button text by clicking on another push button
Call setText() on the other button object.
Since you are using Designer you likely have two member variables accessible through the ui pointer:
then
Code:
void MainWindow::on_pushButton_clicked()
{
ui->pushButton2->setText("CLICKED");
}