You need to write your own slot which will call setEnabled() for the second groupbox. Here what the documentation says about toggled(bool) signal:
If the group box is checkable, this signal is emitted when the check box is toggled. on is true if the check box is checked; otherwise it is false.
If the group box is checkable, this signal is emitted when the check box is toggled. on is true if the check box is checked; otherwise it is false.
To copy to clipboard, switch view to plain text mode
It means that when you enable your first group box the signal is emitted with 'true' and as a result you call setEnabled(true) for your second group box. But as I understand you need to to invert that bool flag. The same thing with clicked() signal.
You need your own signal, smth like this:
connect(groupBox1, SIGNAL(toggled(bool)), this, SLOT(mySlot(bool)));
...
void
mySlot(bool ipFlag)
{
groupBox2->setEnabled(!ipFlag);
}
connect(groupBox1, SIGNAL(toggled(bool)), this, SLOT(mySlot(bool)));
...
void
mySlot(bool ipFlag)
{
groupBox2->setEnabled(!ipFlag);
}
To copy to clipboard, switch view to plain text mode
Bookmarks