I have a dialog containing a QGridLayout with three columns. One of the rows contains a QComboBox, a QPushbutton, and another QPushButton in each column respectively. I want each column to be the same size and scale equally.
Unfortunately, the QComboBox is setting its size hint too large, to be big enough to contain its widest item. It appears there's no SizeAdjustPolicy called "DoNotAdjustAndStopBeingAnnoying" or similar, so I'm not sure if there's anything I can set to force it to stop doing this adjusting.
I know I can do this in code fairly easily, but I would prefer to keep this sort of detail in the .ui file. Is there any way I can do this in Qt 4.8 without writing any code?
I was able to solve this by setting the horizontal component of the
sizePolicy
for the combo box toIgnored
. That resulted in the combo box becoming able to be shrunk further than the buttons, so I changed them to also useIgnored
and set the horizontalminimumSize
for all 3 of the controls. Now they all start out at the same size, and are sized up and down with the layout equally, stopping at an appropriate minimum.