I am not a complete newbie to Qt, but I do have a potentially very simple, very perplexing issue.

I have my Main Window and a separate Dialog Window, both containing a checkbox. Same functionality. When one checkbox is checked, both should be checked. This "syncing" is triggered by a signal/slot mechanism, but as the dialog window is the child of the main window, the checked values are assigned as shown below.

This works for all checkboxes, all set up the same, except one.

In my dialog window's class, I have declared:

Qt Code:
  1. namespace Ui {
  2. class DialogWinow;
  3. }
  4.  
  5. class DialogWindow : public QWidget
  6. {
  7. ...
  8. public:
  9.  
  10. bool checked1;
  11. bool checked2;
  12. ...
To copy to clipboard, switch view to plain text mode 
In my MainWindow class/constructor I have:

Qt Code:
  1. private:
  2. DialogWindow *dialog_window;
To copy to clipboard, switch view to plain text mode 
And in the setup for the MainWindow/DialogWindow, I have these assignations:

Qt Code:
  1. dialog_window->checked1 = ui->checkBox1->isChecked();
  2. dialog_window->checked2 = ui->checkBox2->isChecked();
To copy to clipboard, switch view to plain text mode 

The crazy thing is that the first one of these works just fine. The second one is not working (the value of dialog_window->checked2 remains the same), and even more strange, this works:
Qt Code:
  1. bool checked_temp = ui->checkBox2->isChecked();
  2. dialog_window->checked2 = checked_temp;
To copy to clipboard, switch view to plain text mode 

I have tried a few variations, for example this does not work:

Qt Code:
  1. dialog_window->checked2 = (bool)ui->checkBox2->isChecked();
To copy to clipboard, switch view to plain text mode 

Could this bug be some quirk of Qt Designer? Have I checked some box for this QCheckBox in particular that is causing this assignation to fail? The settings for this QCheckBox seem to be the same as all my other (working) checkboxes.

Thanks in advance for any advice!