Originally I had two QRadioButtons withing Layout which in the end were no exclusive. Therefore I try to add them to a QButtonGroup. Unfortinately I could find no example or these were for Qt3.

If there is a possibility to do all this mainly within the designer that would be great, but I dont know how. So in case please let me know.

This is what I coded so far. But in the end it fails because the QButtonGroup is no widget and I have no idea to add it to the layout.

Qt Code:
  1. radioButtonNoFFT = new QRadioButton(this);
  2. radioButtonNoFFT->setObjectName(QString::fromUtf8("radioButtonNoFFT"));
  3. radioButtonNoFFT->setChecked(true);
  4.  
  5. radioButtonFFT = new QRadioButton(this);
  6. radioButtonFFT->setObjectName(QString::fromUtf8("radioButtonFFT"));
  7.  
  8. buttongroup = new QButtonGroup(this);
  9. buttongroup->addButton(radioButtonNoFFT);
  10. buttongroup->addButton(radioButtonFFT);
  11.  
  12. gridLayoutButtonGroup = new QGridLayout(this);
  13. gridLayoutButtonGroup->setObjectName(QString::fromUtf8("gridLayoutButtonGroup"));
  14. gridLayoutButtonGroup->addWidget(buttongroup);
  15.  
  16. gridLayout->addLayout(gridLayoutButtonGroup, 1, 0, 1, 1);
To copy to clipboard, switch view to plain text mode