I have a dialog in which a user selects the files that needs, it adds (via QPushButton) in a QListWidget, my problem it's that I need to recover all the files from the QListWidget in a QStringList.
I tried like this, but something is wrong:
self.file = QtCore.QStringList()
archivos = self.file
cuenta = self.ventana.listWidget.count()
for index in range(cuenta):
archivos.append(self.ventana.listWidget.item(index))
I think you're missing .text()
after the item:
self.file = QtCore.QStringList()
archivos = self.file
cuenta = self.ventana.listWidget.count()
for index in range(cuenta):
archivos.append(self.ventana.listWidget.item(index).text())