How to add QButtongroup to Layout?
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.
Code:
radioButtonNoFFT
->setObjectName
(QString::fromUtf8("radioButtonNoFFT"));
radioButtonNoFFT->setChecked(true);
radioButtonFFT
->setObjectName
(QString::fromUtf8("radioButtonFFT"));
buttongroup->addButton(radioButtonNoFFT);
buttongroup->addButton(radioButtonFFT);
gridLayoutButtonGroup
->setObjectName
(QString::fromUtf8("gridLayoutButtonGroup"));
gridLayoutButtonGroup->addWidget(buttongroup);
gridLayout->addLayout(gridLayoutButtonGroup, 1, 0, 1, 1);
Re: How to add QButtongroup to Layout?
In the end I now found out that this is everthiny I need to do:
Code:
setupUi(this);
buttongroup->addButton(radioButtonNoFFT);
buttongroup->addButton(radioButtonFFT);
finding this out however caused me about 2 hours of trying to find some code example and implement whatever I could find...