简体   繁体   中英

Connecting selected item on combobox to a row in pyqt5

When a item is pressed in the combobox i want to call the csv and retrive the row which matches when the item clicked in the combobox

class Ui_Dialog(object):
 def setupUi(self, Dialog):
    sales=pd.read_csv ("C:/Users/DELL/Desktop/Info/Topholdings/csv/Master_table.csv")
    sales_article = sales ["Company"] .dropna()
    sales_list = sales_article.values.tolist()
    self.Fundwise = QtWidgets.QComboBox(Dialog)
    self.Fundwise.setGeometry(QtCore.QRect(308, 141, 141, 61))
    self.Fundwise.setObjectName("sales_list")
    self.Fundwise.addItems(arr_list)

In the above code I call the csv file and select the first column as list which is displayed in the combobox,but when the user clicks one of the items in the combobox how to call the selected strings row

def setupUi(self, Dialog):
     #....
     self.Fundwise.activated.connect(self._set_fundwise)

def _set_fundwise(self):
    _data = self.Fundwise.currentData()
    if _data:
       #call selected strings

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM