[PyQt] pyuic4 vs uic.loadUI

Hans-Peter Jansen hpj at urpla.net
Tue Sep 28 20:15:55 BST 2010


On Tuesday 28 September 2010, 18:19:43 pard wrote:
> Hi
>
> I have found that some people use pyuic4 to compile their ui files and
> some load them dynamically using loadUI.
> Does anyone have the pro's and con's of each of these methods? What is
> the recommended PyQT way of doing
> this?

Being impatient, I always keep an eye on any avoidable delays, and that's 
one of them. And since I have to run auxiliary tools anyway (pyrcc4, 
pylupdate4, lrelease), compiling the UI is more or less free anyway..

Here are some simplified Makefile excerpts:

PYRESOURCES = $(patsubst %.qrc,%_rc.py,resources.qrc)
PYUIFILES = $(patsubst %.ui,Ui_%.py,$(wildcard *.ui))

%_rc.py: %.qrc
        pyrcc4 -o $@ $<

%.py: %.ui
        pyuic4 -o $@ $<

all: $(PYUIFILES) $(PYRESOURCES)

Pete


More information about the PyQt mailing list