[PyQt] Variable

Sebastian Roth xsebbi at gmx.de
Mon May 6 15:06:01 EDT 2002


On Montag, 6. Mai 2002 19:39, Boudewijn Rempt wrote:
> But that's exactly what you've asked your script to do! All Qt
> widgets return a QString object when you ask them for text. What you
> need to do, is to convert the QString's to either unicode or string
> objects, using the unicode() or str() functions:
>
>
>    ulist.insert(0,str(a))
>    ulist.insert(1,str(b))

A big thank you! Now it works... 
/me is so happy now.

> (you are aware that you simply append to a list?)

good question ;) I could change it...

> Curiously enough, this same question has just appeared on the PyKDE
> mailing list (which, despite its name) deals mainly with PyQt:
>      http://mats.gmd.de/mailman/listinfo/pykde

oops ;)
BTW: How big is the traffic there? My modem doesn't like me anymore if 
I'm wanting to much from it.

> The PyQt documentation contains a short and clear statement on
> strings, namely that Python unicode objects and strings are
> auto-converted to QString objects when used in Qt method calls that
> expect a QString, but that Qt objects always return a QString.

I didn't read that. I only read that it auto-converts something...;)

> For a more complete treatment:
>
> http://www.opendocspublishing.com/pyqt/index.lxp?lxpwrap=x2068%2ehtm
>
> The rest of the chapter might be of interest to you, too :-).

I should buy this book... could be interesting for my future job ;)

Thank you,

		Sebastian





More information about the Python-list mailing list