> Ah, that helps the problem in my test script. Now I'm encountering a
> problem encoding the input of a QLineedit:
>
>   File "john.py", line 154, in dataFromGuiToUser
>     self.user.data["achternaam"] = self.GAchternaam.text().encode('utf-8',
> 'strict')
> AttributeError: encode

text() returns a QString, which you should look up in the qt-reference-manual. 
That reveals the method

QString::utf8()

which returns a QCString. And that should be converted to a python byte string 
(by means of sip I think)

Then you need to _decode_ it as utf-8 to yield a unicode object. So the whole 
line should read

self.user.data["achternaam"] = self.GAchternaam.text().utf8().decode('utf-8')

Regards,

Diez

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to