Hi,
I have a QComboBox that I fill with QStrings using:
comboBox->addItem(someString);
When I start my GUI application the width of the comboBox is always 70, even if the smallest item is much larger. How can I dynamically set the width of a QComboBox, for instance, to the largest QString within the comboBox?
Thanks!
Edit:
After some further testing I found the following soluiton:
// get the minimum width that fits the largest item.
int width = ui->sieveSizeComboBox->minimumSizeHint().width();
// set the ComboBoxe to that width.
ui->sieveSizeComboBox->setMinimumWidth(width);
Thanks