[PyKDE] PyQt and qtranslator

Phil Thompson phil at river-bank.demon.co.uk
Sat Jan 18 15:03:01 GMT 2003


On Saturday 18 January 2003 11:55 am, Petr Vanek wrote:
> cheers!
>
> this don't work - python/pyqt:
>
> tor = QTranslator( app, "0" )
> tor.load( QString("lokalizacecpp.cs.qm"), "." )
> app.installTranslator( tor )
>
> but this one does - c++/qt:
>
> QTranslator tor( 0 );
> tor.load( QString("lokalizacecpp.cs.po"), "." );
> app.installTranslator( &tor );
>
> why?
> same *po file, same *ui...
> PyQt 3.4 on SuSE8.0

Depends if tor is a global or local variable. If it is local then the 
QTranslator instance will get garbage collected when tor goes out of scope.

Phil




More information about the PyQt mailing list