def populate_combo_box(self):
        """Populate combobox for selecting city."""
        if self.radio_button_production.isChecked():
            self.source = production_api['url']
            available_data = production_api['available_data']

        else:
            self.source = development_api['url']
            available_data = development_api['available_data']

        self.city_combo_box.clear()
        for index, data in enumerate(available_data):
            self.city_combo_box.addItem(data['name'])
            self.city_combo_box.setItemData(
                index, data['code'], Qt.UserRole)
def populate_combo_box ( self ) : if self . radio_button_production . isChecked ( ) : self . source = production_api [ 'url' ] available_data = production_api [ 'available_data' ] else : self . source = development_api [ 'url' ] available_data = development_api [ 'available_data' ] self . city_combo_box . clear ( ) for index , data in enumerate ( available_data ) : self . city_combo_box . addItem ( data [ 'name' ] ) self . city_combo_box . setItemData ( index , data [ 'code' ] , Qt . UserRole )
Populate combobox for selecting city.