我尝试像这样向PySide2中的QStringListModel添加新字符串
self.model = QStringListModel()
n = self.model.rowCount()
self.model.insertRow(n)
i = self.model.index(n,0)
self.model.setData(index= i,value='Hello World!!',role=Qt.EditRole)
它运行正常,直到insertRow(), 但是我有一个 TypeError:PySide2.QtCore.QStringListModel.setData():参数不足 在最后一行。 因为我填充了这个函数中的所有参数。 这个错误是如何产生的,如何解决? 请帮帮我
改变
到
相关问题 更多 >
编程相关推荐