lupo5
11th May 2014, 01:04
Hi
I want to have a hidden checkbox be checked or unchecked depending on which one of two buttons the user presses.
In the mainwindow.ui I've made a connection from one button to the checkbox and selected "clicked()" for the button and "click()" for the check box.
When I run the program the box checks and unchecks when I click the button. My problem is that the check box begins as checked, but I want it to start off as unchecked. Is there a way I can do this?
So far I've tried:
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
QCheckBox checkBox;
checkBox.setChecked( false );
I want to have a hidden checkbox be checked or unchecked depending on which one of two buttons the user presses.
In the mainwindow.ui I've made a connection from one button to the checkbox and selected "clicked()" for the button and "click()" for the check box.
When I run the program the box checks and unchecks when I click the button. My problem is that the check box begins as checked, but I want it to start off as unchecked. Is there a way I can do this?
So far I've tried:
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
QCheckBox checkBox;
checkBox.setChecked( false );