hy,
i'm trying to create my first GUI application, I wanted to create a simple timer application, there is just one button on the interface with START write on it, when I press it I want my timer to start and the text to be changed in STOP. I can manage this, the problem is that when the text is STOP I want the timer to stop, to do this I have to undestrand if the button has got START or STOP write in it. I tried with
void MainWindow::on_pushButton_clicked()
{
if(ui->pushButton->text()=="START")
{
ui->pushButton->setText("STOP");
}
else if(ui->pushButton->text()=="STOP")
{
ui->pushButton->setText("START");
}
}
void MainWindow::on_pushButton_clicked()
{
if(ui->pushButton->text()=="START")
{
ui->pushButton->setText("STOP");
}
else if(ui->pushButton->text()=="STOP")
{
ui->pushButton->setText("START");
}
}
To copy to clipboard, switch view to plain text mode
but none of this statements seems to be true!
can someone help me?
thank's
Bookmarks