How to get a current Item's info from QtGui.QListWidget?
Use QListWidget.currentRow to get the index of the current item:
def print_info():
print myListWidget.currentRow()
print myListWidget.currentItem().text()
A QListWidgetItem does not know its own index: it's up to the list-widget to manage that.
You should also note that currentItemChanged sends the current and previous items as arguments, so you could simplify to:
def print_info(current, previous):
print myListWidget.currentRow()
print current.text()
print current.isSelected()
...
Well, I have listed some of the things you can display about the current item, if you want more than this then you should look through the PyQt Documentation. link
def print_info():
print myListWidget.currentItem().text()
print myListWidget.row(myListWidget.currentItem())
print myListWidget.checkState() # if it is a checkable item
print myListWidget.currentItem().toolTip().toString()
print myListWidget.currentItem().whatsThis().toString()
myListWidget.currentItemChanged.connect(print_info)