hojoff79
29th December 2010, 17:50
I am trying to set up a function that will make a label visible and invisible on alternating times I push a putton. So far I have set up the connection to use the setVisible(bool) public slot when I push the button. I have set up the function to access ButtonClickedHandler(bool) when action clicked(bool) is taken
void MainWindow::ButtonClickedHandler(bool checked)
{
ui->label->setVisible(checked);
}
When I compile and run the program, pushing the button the first time makes the label disappear, but pushing it subsequent times does not do anything, and does not turn the visibility back on. How can I get this to work properly?
Alternatively I've tried to just create a connection between the button using clicked(bool) and the label using setVisible(bool), but I have the same exact problem, the first push makes the label disappear but subsequent pushes do not make it return.
Thank you in advance
void MainWindow::ButtonClickedHandler(bool checked)
{
ui->label->setVisible(checked);
}
When I compile and run the program, pushing the button the first time makes the label disappear, but pushing it subsequent times does not do anything, and does not turn the visibility back on. How can I get this to work properly?
Alternatively I've tried to just create a connection between the button using clicked(bool) and the label using setVisible(bool), but I have the same exact problem, the first push makes the label disappear but subsequent pushes do not make it return.
Thank you in advance