I'm working with QComboBox in PyQt5. I want each item in the QComboBox to hold a value. To demonstrate my idea, I have 3 items in my firstC that are named USD, EUR, BGN
I want each of the items to have a value, like example USD to be able to print('1') on the console, the second item to (EUR) print('2') and so on...
My idea behind this is, when an Item in the QComboBox is selected, to hold a value.
have you looked into QComboBox's "ItemData" methods?
You can use combobox.setItemData(intex, value[, role]) and similary getItemData and itemData
How to add value to each Item in QComboBox