[PyQt] QTreeWidget Problem

simozack simozack at yahoo.it
Mon Nov 3 08:19:32 GMT 2008


2008/11/3 Min Li <inuyashalee at gmail.com>:

> I want to store the selected item in the QTreeWidget into a local variable.
> I use the <variable = self.treeWidget.currentItem()
>
>               print variable>
>
> to do this task. However, it returns the following sentences.
>
>  '<PyQt4.QtGui.QTreeWidgetItem object at 0x0405CE88>
> <PyQt4.QtGui.QTreeWidgetItem object at 0x0407F3D8>'

Reading the documentation about QTreeWidgetItem, you can use the
method text(column) that returns a QString object. column is the
number of the column from which you want to get text.

Simone


More information about the PyQt mailing list