[PyQt] Unicode characters in QTreeView

Doogster thedoogster at gmail.com
Wed Sep 9 21:07:53 BST 2009

> What kind of datatype does python-mpd extract? Is it 8-bit str or
> unicode? If it's 8-bit str, you need to decode it properly before
> passing it to Qt.

Your advice worked. Returning QtCore.QVariant(var.decode("utf-8")) in the model
for the display role instead of just QtCore.QVariant(var) did it.

More information about the PyQt mailing list