Search code examples
pythonqtqtablewidgetqtablewidgetitem

How to get a Value from a Qtable


i have an editable row in my tablewidget. The values are from a .txt. My intension is it to change some Values in the widget, and then make a new .txt with the changed Values. but i dont know how to "extract" the changed Values from the widget.

with

item=self.model.item(1,1)
iteml.append(item)
print(iteml)

I only get:

[<PyQt4.QtGui.QStandardItem object at 0x02DD2A98>]

But I don't want the memory address but the Value. Any Ideas?


Solution

  • Adding on top of Mailerdaimon: If you want the string as a python string instead of a PyQt4.QtCore.QString object, you can simply use

    item=self.model.item(1,1)
    thestring = str(item.text())
    

    (Sorry, I would have posted a comment, but I'm not allowed since I don't have 50 rep.)