Whenever I attempt to store the selected value from a listWidget using
foo=self.listWidget.currentItem()
this is what I get as a value for foo:
<PyQt4.QtGui.QListWidgetItem object at 0x023BDD68>
This sort of makes sense, but is clearly not what I was asking it for. I'm aware of round about ways to get the actual item selected but is there not some one line method for doing this, like there is for every other input widget?
From the PyQt4 QListWidgetItem docs, you could use:
item = self.listWidget.currentItem()
value = item.text()
Or on one line:
value = self.listWidget.currentItem().text()