When i insert a dictionary like {"B": 1, "A": 2, "D": 3, "C": 4} into a PyQt5 ComboBox, the dict will be alphabetically sorted by the keys. How can i prevent this and keep the original order?
Example:
dictionary = {"B": 1, "A": 2, "D": 3, "C": 4}
self.comboBox.addItem("Test", dictionary)
print(dictionary)
print(self.comboBox.itemData(0))
This outputs:
{'B': 1, 'A': 2, 'D': 3, 'C': 4}
{'A': 2, 'B': 1, 'C': 4, 'D': 3}