[PyQt] Re: Problem with QString API v2

Phil Thompson phil at riverbankcomputing.com
Fri Dec 18 15:43:47 GMT 2009


On Fri, 18 Dec 2009 15:34:19 +0100, detlev <detlev at die-offenbachs.de>
wrote:
> Hi,
> 
> how do I port code like
> 
>>>> l="hh"
>>>> t=app.translate("Test", "s - %1 - e").arg(l)
> 
> to the QString API version 2? I need to have the relocatable
placeholders.

Use Python's...

    t = app.translate("Test", "s - {0} - e").format(l)

Phil


More information about the PyQt mailing list