[PyQt] Problem with QTreeWidgetItem clone()

Jamie Riotto jamie.riotto at gmail.com
Wed Feb 3 22:21:59 GMT 2010


Hi,
I have a QTreeWidget which I attempt to copy by:

root = treeWidget.topLevelItem(0)
clone = root.clone()

and I use clone to populate a new QTreeWidget. All the children are
there, the problem is
that all children have their 'hidden' flags reset. That is, any
'hidden' items in the
first tree become visible in the new tree. This of course forces me to
iterate over the original
tree which negates the usefullness of clone() (at least in this instance).

Am I doing something wrong? I kind of assumed a deep copy would
preserve things like
hidden, selected, etc.

Thanks - jamie


More information about the PyQt mailing list