Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QGroupBox, 2 Radio Buttons, not big enough



  • I have a QGridLayout, in this layout I have added a QGroupBox this group box has two QRadioButton instances. The text to go with each radio button is Male and Female. When this is rendered both texts are cut short, Male only shows Mal with e cut in half, Female only displays Fem, the group box is just to small. Why does this happen and how can I avoid it?

    On the form the is plenty of space on the row that contains this group box.



  • @SPlatten add size policies to your widgets. Make a small test case in Qt designer and layout your widgets there to make sure your widgets resize properly. Check the C++ code from the ui file generated in designer. Then you will know where your problem is.



  • @SPlatten

    Your QGroupBox is in a QGridLayout, but does your QGroupBox have any layout? From your description it looks like you've put your QRadioButtons in without applying a layout.



  • @JoeCFD , thank you for the response, my widgets are manually positioned and added to groups in code.

    Yes, I create the QGridLayout first then a QGroupBox, I've resolved this issue now.


Log in to reply