QComboBox, PyQt5 - Numbers in Item strings are reordered

174 views Asked by At

I'm encountering the following (weird) behaviour when adding items to a QComboBox using PyQt5: The items are all added from a list of strings, but they are displayed correctly only when selected. When appearing in the drop-down list, the order of the numbers contained in the strings is changed:

my_list = ["200 x 300",
           "240 x 550",
           "400 x 120"]

# same list, but with the correct multiplication symbol:               
my_list2 = ["200 × 300",
            "240 × 550",
            "400 × 120"]

combobox1.addItems(my_list)
combobox2.addItems(my_list2)

This is what it looks like:

enter image description here

enter image description here

Why does this happen? What can I do to fix this or is it a bug?

0

There are 0 answers