[PyQt] pyuic vs. uic.loadUi()?

Phil Thompson phil at riverbankcomputing.co.uk
Fri Jun 15 17:05:26 BST 2007


On Friday 15 June 2007 4:34 pm, Dirk Reiners wrote:
> 	Hi Everybody,
>
> as I said already I'm just starting out using PyQt and therefore I would
> like to tap into the experience pool on the list to avoid making
> fundamental mistakes early in the project that are hard to fix later.
>
> I'm trying to decide whether to a) use pyuic4 to generate a python module
> to include, or b) use uic.loadUi() to load the .ui file directly.
>
> As far as I can see the only possible disadvantage of b) is the time it may
> take to create the ui compared to just loading the .pyc file. The advantage
> is not having to remember to run the build system (scons in my case, thanks
> to Patrick Hartling for the pyuic builder!). A difference (neutral) is not
> being able to derive from the module and avoid having to add .ui to access
> the ui variables, but that doesn't look like a big deal.
>
> Is there something more that I'm missing?

It's the same code doing the work in both cases. Actually that's not quite 
true. With a) it's your copy of the code that is doing the work, with b) it's 
your user's copy of the code that is doing the work.

Why can't you derive if you use uic.loadUiType()?

Phil


More information about the PyQt mailing list