I want to make one toggle functionality in QT like when I click on the pushButton then I want something else in the Label and when I click another time then I want another text value.
<code>void MainWindow::on_pushButton_clicked(bool checked)
{
if (checked) {
ui->label->setText("Yupp It's working..!!");
}
else {
ui->label->setText("Toggle completed..!!");
}
}```
So what I want is that when I click for the first time I want Yupp It's working..!! and second time Toggle completed..!! and third time repeat this.
I try 2 slots
1. clicked()
2. toggled()
But it is not working for both slots. It looks like not go inside the function.
And one more thing how can I check this like any print() or console.log() type function that I can use for debugging?
</code>
<code>void MainWindow::on_pushButton_clicked(bool checked)
{
if (checked) {
ui->label->setText("Yupp It's working..!!");
}
else {
ui->label->setText("Toggle completed..!!");
}
}```
So what I want is that when I click for the first time I want Yupp It's working..!! and second time Toggle completed..!! and third time repeat this.
I try 2 slots
1. clicked()
2. toggled()
But it is not working for both slots. It looks like not go inside the function.
And one more thing how can I check this like any print() or console.log() type function that I can use for debugging?
</code>
void MainWindow::on_pushButton_clicked(bool checked)
{
if (checked) {
ui->label->setText("Yupp It's working..!!");
}
else {
ui->label->setText("Toggle completed..!!");
}
}```
So what I want is that when I click for the first time I want Yupp It's working..!! and second time Toggle completed..!! and third time repeat this.
I try 2 slots
1. clicked()
2. toggled()
But it is not working for both slots. It looks like not go inside the function.
And one more thing how can I check this like any print() or console.log() type function that I can use for debugging?