[PyKDE] self.trUtf8("<string>")

Phil Thompson phil at river-bank.demon.co.uk
Tue Jun 18 23:57:01 BST 2002

Karl wrote:

> Hi!
> I have build a project using the Qt Designer for Qt 2.3. When I compile 
> the .ui file with pyuic, it uses the function self.trUtf8("<string>") 
> for captions of Buttons etc.
> When I want to use the class created, python tells me that there is an 
> "attribute error" in all the lines where this Utf8 is used. When i just 
> remove the function call and use the string itself, everything works 
> fine. But this is of course not a solution as I would have to replace 
> all occurances everytime after recompiling the .ui file.
> What's wrong and what can I do?

Looks like your are using pyuic for Qt3 (which uses trUtf8()) rather 
than pyuic for Qt2 (which uses tr()).


More information about the PyQt mailing list