1

In my app a user can increase/decrease the font size by calling a css file with the new size definitions, and updating the stylesheets. However, I have issues with some widgets after the size changes.

The first one is that QComboBox items are overlapping:

img

I tried to set the height of the items but it doesn't seem to work:

QComboBox QAbstractItemView {
    height: 30px;
}

Btw, if I add the command "color: red;" it does work. But the height doesn't.

The second one is that the drop-down of a QComboBox is not getting wider and the text is being cut

img

I have some more issues, but I hope your answer will help me with the rest of them.

Any suggestions? Thanks!

Spektre
  • 49,595
  • 11
  • 110
  • 380
Dan Tavori
  • 11
  • 1

1 Answers1

0

Basically, in order for it to adjust to contents, you need to set SizeAdjustPolicy of your QComboBox to AdjustToContents, make sure it is inside a suitable layout so that the SizePolicy is used and provide enough space for it to resize. Check out this thread How do I set the QComboBox width to fit the largest item?