To get a python string copy of the contents of a QString object, I have been using unicode(some_qstring) .
>>> qs = QString(u'BAZ') >>> len(unicode(qs)) 3 So I was surprised when I did the analogous thing to get a python string copy of the contents of a QChar. >>> qc = QChar(u'Z') >>> len(unicode(qc)) 24 >>> unicode(qc) u'PyQt4.QtCore.QChar(0x5a)' It appears to produce the _repr_ value. Is this intended? Investigating I find that QChar has a unicode() method which assistant says returns a ushort. >>> qc.unicode() 90L note the L suffix - is this an artifact of the cpp interface code or what? In the end this is the only way I see to make a QChar into a python string: >>> unicode(QString(qc)) u'Z' Thoughts? _______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt