[PyKDE] Using UI files in your app with PyQt4

Giovanni Bajo rasky at develer.com
Sun Jan 22 23:52:51 GMT 2006

Torsten Marek <shlomme at gmx.net> wrote:

>> def compileToType(filename):
>>     code_string = cStringIO.StringIO()
>>     widget_info = Compiler.compileUi(file(filename, "r"),
>>     code_string) # the buffer code_string now contains the generated
>>     Python code widget_module = compile(code_string.getvalue(),
>>     filename, "exec") exec widget_module
>>     return locals()[widget_info["uiclass"]]

This ought to be included within PyQt4.uic!

Giovanni Bajo

More information about the PyQt mailing list